Python Programming


Software from


  • To create a new script in IDLE: use FILE / NEW.
  • To run a script or program in IDLE, use RUN / RUN MODULE (or F5).
  • Using line numbers: Line Numbers are not displayed on the left-hand side. However, you can go to a specific line with Edit / Go to Line. Also, note that there is a line/column indicator in the lower right corner of the
    IDLE window.

Notes on using Python’s IDLE in Windows:

In order to set a default directory for your programs so that Python does not save them with the rest of Python, you can reconfigure the shortcut on your desktop to specify your own working directory. To do that, right-click on the shortcut on your desktop and choose Properties. In the “Start In:” line, enter your own folder, for example C:PythonClass and then click OK.

Notes on De-bugging in Python’s IDLE:

  • In the SHELL, click on DEBUG / DEBUGGER
  • Select your options (e.g. LOCALS / STACK )
  • Use STEP to go through the program one line at a time and follow how the program executes
  • Use GO to run the program to finish the way that it normally would run (in other words, to stop the STEP behavior).

Additional Python Resources and notes:

Safari Online at the Bobst

Online Resources:

String methods -

Mutable Sequence Types (e.g. lists) -

Mapping types (e.g. dictionary) -

File objects (File IO) -

Working with urllib.request for obtaining data from webpages -  and

Working with CSV files – reading and writing -

Some of the differences Between Python 2.x and Python 3.x

Some of the differences to keep in mind with respect to the CSCI-UA.2 syllabus material; there are many more:

Topic Python 2.x Python 3.x
Print statement print ‘Hello, World!’ print(‘Hello, World’)
Data entry: text name = raw_input(‘What is your name? ‘) name = input(‘What is your name? ‘)
Data entry: numbers (values) age = input(‘What is your age? ‘) age = input(‘What is your age? ‘)
age = int(age)
Integer arithmetic: division
>>> 7/2

[ where 7 and 2 are integers]

>>> 7/2
>>> 7//2