Installing Python 3.1

Installing the Python language on your computer is not difficult, and it will greatly simplify your life if you can do your assignments on your own machine.

We will use Python 3.1.2, NOT Python 2.7. If you write a program using Python 2.7 (or any version earlier than Python 3.0), it will not work when we try to grade it. So please be careful to install 3.1 and NOT 2.7.

Here is a short handout on translating Python 2 to Python 3.

Installing Python for Windows

To install Python, go to the official Python download page, and select the right Python 3.1.2 installer for your system. The Python 3.1.2 installers are in the middle of the page.

When the installer runs, just keep clicking "Next" to accept the standard installtion options, and finally "Finish".

When you are done, if you left-click on the Start menu at the bottom-left of your screen, and then "All Programs", you should see "Python 3.1" in the list of programs you can run. Click on it, and then select "IDLE- Python Interpreter" to get started! (Note: not "Command line").

Installing Python on a Mac

OS-X comes with a version of Python pre-installed. But it's an older version, and we will be using version 3.1.2, so you have to install it as well. This means you will have two Pythons, but you know if you are using IDLE that you are using the new one, since the pre-installed Python does not include IDLE.

From the official Python download page, install the .dmg for Python 3.1.2. After installing, you should find Python 3.1.2 in the Applications folder, and you can put the IDLE icon your dock.

Here is the main Web page about Python.

PyScripter

The PyScripter program is a much fancier program for writing and looking at Python programs than IDLE. We will use it in class to watch programs running step by step. It is available for free from MMM-experts, unfortunately only for Windows.

Graphics module

The graphics module is available on Prof. Zelle's home page, where you will also find documentation describing the things it can do.

Running both IDLE and the graphics module at the same time might lead to trouble. On Windows, a good strategy is to use IDLE to edit the program, as usual, but run it by double-clicking on the program. On the Mac, control-clicking on the program, and then say "Run with...", lets you run it with PyLauncher (the little rocket). This brings up two other windows besides the graphics window (which is kind of ugly), but it works. The graphics window might end up behind these other windows, so you might have to look for it. If you can't get this to work, email us or (better) come see us in Lab Hours.