Getting Started with Python

"IDLE" is the tool we will use to create and run Python programs, instead of typing in the command line. IDLE gets installed on your computer when you download and install the latest Python:

It could take a few minutes to install Python and IDLE. Your teacher will give you instructions on what to do while waiting.

Once you have finished installing, launch the IDLE application:

  1. In your Applications folder there should be a new folder named "Python".
  2. Inside the Python folder is an application named IDLE. Double click it.

Click to enlarge

This window is where output from our programs, and other system messages will appear.

Now from the "File" menu pick "New File". You'll get an untitled text editing window.

In that window, type:

print "Hello!"

...and then save the file. (Give them advice on where to save and what to name it.) You probably want to create a folder for your Python programs and put it in there. You can name it whatever you want, but you should give it the ".py" extension. For instance, "hello.py".

Once the file is saved, from the "Run" menu pick "Run Module". Your output window will now look something like:

Click to enlarge

And that's it! You're now a programmer! All of our exercises in Python will be written and run this way. Every time we program we will: