Lab 1: Software installation and first steps in Python

In the first lab of the course we will first install all the necessary software on the computer, and then we'll start using Python.

Software installation

These instructions are for Microsoft Windows users. All necessary software is also available for Linux and Mac OS X, but there are no instructions here. In class, I will mostly use Linux.

  1. Download the Python interpreter and environment python-2.6.4.msi (original here) and install it.

    On 64-bit Windows machines, use python-2.6.4.amd64.msi instead.

    When the installation asks for the Destination Directory, keep the default C:\Python26\. Do not change anything on the customization page.

  2. Download the Wing IDE 101 wingide-101-3.2.3-1.exe (original here) and install it.

  3. Download and install the Python imaging library (PIL) PIL-1.1.7.win32-py2.6.exe (original here).

    On 64-bit Windows machines, use instead.

  4. Download the zip file and store it on your desktop. Then right-click the file icon, and select Extract. When it asks for a directory, select the directory C:\Python26\Lib\site-packages.

Pair programming

Congratulations--you have installed all the necessary software! Now it’s time for you to do some programming. To earn your lab marks, you must actively participate in each lab.

We will ask you to do pair programming during the labs. Pair programming is used in software design (for instance, it is part of "Extreme Programming"), and you can find an explanation of the benefits of pair programming on Wikipedia--but read that later!

We will use the terms driver and navigator. Here are the definitions of the two roles:

Here is the most important rule for this and all future labs: The navigator must not touch the keyboard or mouse. The driver’s role is to work with the computer, and the navigator’s is to think about language issues and upcoming issues related to the problem being solved. If the navigator interferes with the driver, the group loses the view of what is coming up and may make the problem harder to solve and makes it harder for the driver to learn the material.

The two members of a team should switch roles every 15 minutes or so.

First steps in Python

Today we will just learn how to use the Wing IDE 101, how to run Python code interactively from the Python shell, how to write a Python program (also called a script), and about basic Python syntax--including putting comments in your script.

We make use of the robot examples in the robot lecture notes. By the end of the lab, you should be able to do everything described in the lecture notes up to Section 4 ("Write programs for humans").

Otfried Cheong