Introductory Programming: Setup

The most straightforward way to write a Python program is to write your program in a text file, and run the program from the command line. If you have not already, you will do this during the Unix workshop.

But for this workshop, we'll use a web-based Python environment called JupyterHub so that we can try out bits of program code faster.

For this workshop, we'll use the servers we set up in Week 1. You will need the IP address of the server that you have an account on. You'll also need your username and the password you set in Week 1. If you haven't done the Week 1 lab, you should do Part 1 of that lab now to set your linux password, before you continue.

Your server IP address depends on the first letter of your username. They are:

  • username starts with a-g: 115.146.85.246
  • username starts with h-n: 144.6.225.106
  • username starts with o-z: 130.56.249.93

JupyterHub on our servers

Open a web browser (use Chrome or Firefox) and enter the URL http://<ip-address>/jupyter , remembering to replace <ip-address> with the address of the right server for you. It should be one of these links:

This should get you to JupyterHub. This is a web-based Python programming environment. You can log in with the same username and password you used when you used ssh to connect to linux - this is the password you set in Week 1.

Once you're logged in, you should see a listing of the files and directories in your home directory on the server. At the top right of the window is a button labelled New, which will open a drop-down menu. Open this drop-down menu and select Python 2 to start a new Notebook using Python 2.

You're now set up and can go on to the workshop exercises.

IPython Notebook on your Laptop

If you prefer, and have Python installed on your laptop, you may be able to run IPython Notebook (Jupyter) there instead of logging in to the server. On Mac or Linux, open a terminal and type

ipython notebook

If everything is installed, this will launch IPython Notebook in a web browser. Click "New Notebook", and you're done.