Home

First created: Tuesday 8th March 2005, 7:28 PT, AHD
Last updated: Friday 2nd February 2007, 11:00 PT, AHD

 

 

Creating and running a Python program using the IDLE editor

 

1.  Start IDLE ...

 

 

 

You will then see a window entitled "Python Shell" ...
 
 
 
 
 
2.  From the Python Shell window, select New Window from the File menu.
 
3.  You will see a window entitled "Untitled"
 
 
 
 
4.  From the File menu, select Save As, 
     and select a folder to save your Python program file.
 
 
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.
 
 
 
 
8.  Type in the following text into this window 
     (make sure the word print is all in lower case):
 
     print  "Hello World!"
 
     The text will automatically change colour to look like this:

 

     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. 

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

     Select Python Docs from the Help menu or press keyboard key F1.

****************************************************************

     To exit the Python Shell or IDLE editor

     Select Exit from the File menu.
 

****************************************************************