Copyright Anne Dawson 2005 - 2018

This file is: http://www.annedawson.net/Python_Install_Run.htm
First created: Tuesday 8th March 2005, 7:28 PT, AD
Last updated: Monday 1st March 2021, 11:46 PT, AD

How to install Python 2.x and run Python 2.x programs using the IDLE editor

by Anne Dawson PhD

Watch the Python IDLE Editor installation movie below...

Python with IDLE installation video (11 minutes)

Watch the IDLE Editor movie below (11 minutes)...

Python Editor IDLE video (11 minutes)

Python Programming movies by the same author...

Skip to IDLE Instructions (assumes Python installed)
Example Python 3.x Programs
Example Python 2.x Programs
Python Programming Resources
Python Programming Hint Sheet
Python Useful Links

More Python Resources

Python programming movies (many)

Important note:


At the time of writing this document the current version of the
Python interpreter software is version 3.0.1. Please note that Python 3
is ***NOT*** compatible with earlier versions of Python. 

An instruction manual for Python 3.0.1 is available here.

Which version of Python should you install?


Be aware that there are some significant differences between Python 3
and earlier versions. For beginner Python programmers, the main ones
are that the print statement of Python 2.x is now a print function in Python 3,
the raw_input function in Python 2.x is replaced by the input function in Python 3,
and an integer division such as 2/3 in Python 2.x is now a real division
in Python 3. 

For experienced programmers, also check out 
the range() and string formatting differences outlined here:
http://inventwithpython.com/appendixa.html


A full list of differences between Python 2.x and Python 3 can be found here:
http://docs.python.org/3.0/whatsnew/3.0.html.
Newer versions of Python 3 will be released in the future.
Newer versions of Python 3 will (hopefully) be backward compatible - 
which means that if you write Python programs using version 3,
they should still run using future versions of the Python 3
interpreter. You should always download the latest version of the
software as it will contain the latest features and bug fixes.

1. Go to the Python web site


http://www.python.org

You will see this screen:

Python installation screen 002



2. Download the Python software





The instructions on this page were written for Python version 2.5 
and should work for all versions 2.x. An instruction manual for Python 3 
is available here.





Click on the DOWNLOAD link on Python's home page. 

You should then see the following screen:


Python installation screen 004




To download and install Python for Windows XP, click on the link for
Python 2.5 Windows installer shown in the screen above. 


[Note, if you're running a version of Windows other than Windows XP, you may need to install the Microsoft Installer first.
In this case, click on Python 2.5  (September 19, 2006) on the screen above and follow the friendly instructions. 
Instructions for installation using other operating systems can be found on the same page.]


Python installation screen 006



Click on Save File to save the file to disk...



Python installation screen 008




If you're using Firefox and Windows XP, the following file is saved
to your desktop. Any other operating system or browser will save the
file to your specified folder. Locate the file (python-2.5.msi) on your desktop
and double click to start installing Python.

You will then see this screen:

Python installation screen 010



If you have multiple users on your computer, just click on the Next
button, otherwise click on the Install just for me, then click on
the Next button.  

You then see the following screen...

Python installation screen 012


Just click on the Next button to install Python into the C:\Python25\ folder.

You will then see this screen:


Python installation screen 014



Just click on the Next button to install all available features.

After a short time, you will see this screen:


Python installation screen 016


then this screen:


Python installation screen 018



Click on the Finish button to complete the installation.  

After the installation is completed, 
you can then start up Python's editor (IDLE)
to create and run Python programs, see below...

Watch the IDLE Editor movie below (11 minutes)...

Python Editor IDLE movie








Follow these instructions to write and run a simple Python 2.x program using the IDLE editor:



Python installation screen 020




1.  Start IDLE (see screen above). You will then see a window entitled "Python Shell" ...


Python installation screen 022




2.  From the Python Shell window, select New Window from the File menu.

3.  You will see a window entitled "Untitled"



Python installation screen 024



4.  From the File menu, select Save As, 
     and select a folder to save your Python program file.

Python installation screen 026



5.  Select a folder to save your file in.

6.  In the File name: text box, type: program1.py

7.  Then click on the Save button. 
     You will then see a blank editor window ready 
     for you to type in your Python program.




Python installation screen 028





8.  Type in the following text into this window 
     (make sure the word print is all in lower case):

     For Python version 2.x:

     print "Hello World!"

     The text will automatically change colour to look like this:

     print "Hello World!"

     NOTE: For Python version 3.0 type:

     print ("Hello World!")


9.  To run this program, select Run Module from the Run menu.


     You should see a reminder to save the Source (your program). 
     Click on OK to save.

     Then you will see your program running in a Python Shell window.


10.  Close all Python windows to quit Python.






IMPORTANT: 



To open your Python file again, 
locate the file in the folder, 
click once on the file name it to highlight it, 
then right-click on the mouse to see the options shown in
the screen below, and select Edit with IDLE 
to open the editor window. 


Python installation screen 030



From the editor window (the window with the program's name in the title bar),
select Run Module from the Run menu to 
see the program run in the Python Shell window.



****************************************************************
    To close a Python Shell or IDLE editor window
     Select Close from the File menu. 
****************************************************************
    To open and run an existing program file
     Select Open from the File menu.
****************************************************************
    Getting Help on IDLE
     Select IDLE Help from the Help menu
****************************************************************
    Getting Help on Python
     You select Python Docs from the Help menu or press keyboard key F1.
     The path for Python 3.0 is not correct - IDLE currently searches for documents here:
     http://docs.python.org/dev/3.0/ 
     when the Python 3 documentation is actually located here: http://docs.python.org/3.0/ 
Documentation for all versions of Python can be found here: http://docs.python.org
**************************************************************** To exit the Python Shell or IDLE editor Select Exit from the File menu. **************************************************************** Example Python 2.x Programs (HTML format) Example Python 3.x Programs (HTML format) Example Python 2.x Programs (text format) Example Python 3.x Programs (text format) For experienced programmers, also check out IDLE's debugging tools at: http://inventwithpython.com/chapter7.html Search for more computer science topics on www.annedawson.net

www.annedawson.net

Valid XHTML 1.0!

Valid CSS!