Use a text editor
Nano Cheatsheet
After logging in to your HPC cluster, start a terminal
and type nano
to start the text editor called ‘nano’.
CTRL-O: save
CTRL-X: quit
The clusters provide these text editors on the command line:
nano
vi, vim
emacs
We recommend nano
unless you are used to another editor:
Any of the above links would be helpful for you.
Exercise
Let’s make a script with the name
example.py
$ nano example.py
Insert the following text
# This program prints Hello, world!
print('Hello, world!')
Save and exit. In nano:
<ctrl>+O
,<ctrl>+X
You can run a python script in the shell like this:
$ python example.py
# or
$ python3 example.py