These pages contain the notes and excercises for a medium-length (two afternoon) course designed to introduce Earth Science PhD students to the Python programming language and some of the more useful libraries. I’ve assumed everybody is happy with basic procedural programming (i.e. can write a loop, if statment and function in something like Fortran or Matlab). The course is made up of four lectures and four practical sessions. Material can be downloaded from the links below.
-
Lecture 1: An introduction to the Python language and landscape. The language syntax. (keynote|pdf)
-
Lecture 2: Using Python. Built in types, Writing scripts and modules, the standard library. (keynote|pdf)
-
Lecture 3: Object oriented programming with Python. (keynote|pdf)
-
Lecture 4: Science with Python. NumPy, SciPy and Matplotlib. (keynote|pdf)
-
Practical 1: Syntax and types. (files|solutions)
-
Practical 2: Scripts and modules. (files|solutions)
-
Practical 3: Object oriented programming. (files|solutions)
-
Practical 4: NumPy, SciPy and Matplotlib. (files|solutions)
I have also provided some information on how to go further and find more help and how to install Python on your computer.