This page contains information from a previous year and will be updated before the first day of class.

Books

There is no official textbook. Here are some recommendations:

Online Resources

Using the Command Line

To successfully complete the Python course you need to become comfortable using your operating system's command line terminal. There are many tutorials on using the command line online.

Windows does not have a Unix-like terminal built in. The Windows command prompt is far less powerful than a typical Unix terminal. I recommend you take a look at Cygwin, which provides a native Windows implementation of many powerful Unix tools, including a powerful command line terminal.

Installing Python

Make sure to download Python 3.4.1. The code we will write in this class won't run on Python 2.x interpreters!
Mac OS X and Linux will have Python pre-installed, but usually only version 2.7 (or older).

The easiest way to install Python is to use your operating system's package manager (if you use Linux or a package manager in OS X). Cygwin for windows contains a package manager as well.

If you do not use a package manager on Mac OS X or you use Windows, you can download Python from https://www.python.org/downloads.

Running Python

Running the Python Interpreter (Read Evaluate Print Loop)

Open your terminal (see section "Using the Command Line" above). Then type "python" to run the interpreter in interactive mode. If you have multiple versions of Python installed (e.g. both 3.4.x and 2.7), you sometimes need to specify the version number (e.g. "python3" or "python3.4".

If you use Windows, the command is often "py". If this gives you the wrong interpreter version, try "py -3"

Running Python Programs

A Python program consists of one or more Python source files with the suffix .py. The class will cover the structure of Python programs (which can also be in different sub-directories) in more detail. .py files are simple text-files, encoded in ASCII or UTF-8. You will have to use a basic text editor to create and edit these files. Examples of text editors are (in order of difficulty and powerfulness) Notepad (Windows), Textedit (Mac), Jedit, SublimeText, Nano, Vim, Emacs. There are also some IDEs that support Python, but I recommend a basic text editor while you are still learning the ropes.

Open your terminal (see section "Using the Command Line" above). Change into the directory that contains the Python file you want to run (for instance source_file.py). Then run "python source_file.py" (or "py source_file.py" on Windows). If your program does not work, Python will tell you the type of the error and the line in the source file that contains the error. You can then change your code, save, and run the program again. It makes sense to keep the command line to run Python and the text editor open at the same time. The class will cover debugging techniques in more detail.