GavilanCSIS 42
Python Programming

This lesson will show you how to get up and running with the python language.

You should have a computer running Windows, Linux, or Mac OS, and preferably have administrative rights on that computer.

After completing this lesson, you should be able to start up the python interpreter, type in commands, and see the output.

 

Getting Started

Get python

The first thing to do is get python onto your computer. It is available for every major platform (Windows, Linux, and Mac) and it is free.

At the downloads page, you will find the most current links for downloading python for the various platforms. (We'll be using version 2.5.2 in this class, but any version after 2.0 should work fine).

Here is a faster link to download the right package:

(Please note that Macs and Linux should already have python installed. Try typing python -V at the command line to see what version is installed.)

 

 

Install python

This step is really only necessary if you are running Windows.

The last section directed you to download a file called python-2.5.2.msi. If it doesn't run automatically, you should double-click it and get the installer running.

You might be asked for the password to your computer.

 

Run it for the first time

In its most basic form, using python is a text-based activity. That means no pretty pictures, and no mouse clicking. Keyboards only! (Expect to be a better typist by the end of this class.)

From the windows start menu:

[[ unfortunately, I don't have access to a windows machine to give you step by step instructions for installing python. Check in at the Forums for this class to see if your classmates have made progress with this task. ]]

Also, see the relevant section from Dive Into Python

From the windows command line:

Try the following:

python -i (enter)

From the Mac OS:

You need to get a Terminal window up. Locate the program Terminal.app inside your Applications -> Utilities folder. (You might want to drag Terminal.app to your dock. You'll be using it quite often.)

Once the Terminal window is up, you should be able to type:

python -i (enter)

From Linux

If you're running linux, then you almost certainly know how to get to a command line and run python. Do so now.