Thanks to Dr. Alan McLeod for the content of this page.

Installing Python

Python development tools will be available on the lab computers, but if you wish to work at home (and you certainly may!) you can get them for free. The lab computers are likely to have versions 3.0 or 3.1, and for this course either version is fine. Several Python development tools are available, but we will use the ones supplied from the central Python web site, www.python.org, so we get used to a consistent "look and feel".

Windows

From the python.org web site, follow the Download link given at the left of the main page. Look through the list of available hardware platforms and operating systems to find the one that matches your system. As of this writing the current "production" version of Python is 3.1.3. For a Windows PC, you would be downloading the file python-3.1.3.msi - look for a link named Windows x86 MSI Installer. Double click on the filename to start the installation process. It is OK to install the software in a folder called Python31 on your hard drive.

If you have a 64-bit Windows machine you can download and install the 64-bit version of Python, but it will not work with the pygame module (see below), so you may as well stick with the 32-bit version, which will run fine on a 64-bit machine.

Other Operating Systems

There are versions of Python for UNIX and the Mac, but this course will only "officially" support running Python on a Windows-based machine. However Mac users have been able to run Python in the past with a minimal amount of support.

Other Development Environments

ActivePython from ActiveState is another solid development environment and you might even want to play with PortablePython, which can run off your USB stick! Both of these tools are linked off the python.org downloads page.

Running Python

[Python Program Group]

After installation, you will see the new program group shown to the right. Feel free to explore each of these new programs (even the last one if you want). IDLE is a tool that allows you to create, edit and run a Python script or program. The tool also includes its own Python prompt. This is the environment we will use most often. With Module Docs (in the little pydocs window that opens up, choose open browser) you can peruse extensive documentation for the modules that are shipped with Python - not something you will need right now! Python (command line) gives you a ">>>" Python command prompt where you can type in Python commands and immediately see the response. Type in quit() to close this window.

Python Manuals will give you access on your computer to an extensive set of help documents. You will see a link to a Tutorial here, which is not a bad starting point to learn how to program in Python. But it is not the only place to get this kind of information. You should check out some of the other links on the course website if you are looking for information to compliment or substitute for the textbook.

Textbook References

Appendix A in the textbook discusses the installation process and Appendix B offers a nice introduction to using IDLE.

Pygame

If you look around the python.org site you will find an ever-expanding list of third-party code modules that support a wide variety of programming needs. One such module, Pygame, supports the development of games. We can use it without having to add much extra code to our programs to jazz things up a little. The main web site is pygame.org, and you will see a link to Downloads at the left. Look for the download for your OS and hardware. For example, for Windows you would choose the file pygame-1.9.1.win32-py3.1.msi. Note that there is no 64-bit version of Pygame, so you must download the 32-bit version and run it with the 32-bit Python version.

Pygame should be available in JEF lab, but it has not yet been tested. We won't be using Pygame right away in this course, so you can postpone installing Pygame until you are more comfortable with Python itself.