Building Programs with Python

The best way to learn how to program is to do something useful, so this introduction to Python is built around a common scientific task: data analysis.

Our real goal isn’t just to teach you Python, but to teach you the basic concepts that all programming depends on. We use Python in our lessons because:

  1. we have to use something for examples;
  2. it’s free, well-documented, and runs almost everywhere;
  3. it has a large (and growing) user base among scientists; and
  4. experience shows that it’s easier for novices to pick up than most other languages.

But the two most important things are to use whatever language your colleagues are using, so that you can share your work with them easily, and to use that language well.

Setup

You need to download some files to follow this lesson. First, you need to open a terminal:

Once you’ve done this, a window should appear. Type the following into the prompt that appears (pressing enter/return after each line):

$ cd
$ git clone https://github.com/Southampton-RSG/swc-python-novice-websci.git

Alternatively, if you have SSH authentication with GitHub enabled (if you don’t know what this means don’t worry, it is covered in the Git SWC course if you want to know more!) you can use the following:

$ cd
$ git clone git@github.com:Southampton-RSG/swc-python-novice-websci.git

This should download all the content for the lesson to a new directory. Please let the instructors know if you run into any problems.

Topics

Other resources