Use a text editor

nano cheat sheet

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:

Challenge

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 the Python script in the shell like this:

python example.py

or

python2 example.py