[Tutor] I cannot "run" any Python programs

Alan Gauld alan.gauld at btinternet.com
Thu Feb 23 01:37:58 CET 2012


On 22/02/12 23:29, Tamar Osher wrote:
> Thanks! I hope to find a Windows7 expert to help me.

You don't need a Windows 7 expert, just to set things
up properly.

First open up Notepad++ again and enter everything between
the #### then save to a file called myHello.py and exit Notepad++.

####################
print ("Hello world, Python calling!")
input("Hit return to exit")
####################

Find myhello.py in Windows explorer and double click it.
(It's probably a good idea to create a special folder to
store your python programs. It'll be easier to find them
in the future!)

If python is installed correctly a black window should
open displaying:

Hello world, Python calling
Hit return to exit

If you hit return the window should close.

Now open the  same file in IDLE (File->Open)

You should have a new edit window.
In IDLE  choose the Run->Run Module menu item.

Your program should now run inside IDLE and display its output in the 
Python Shell window of IDLE. When you hit return this time IDLE stays 
open but returnms to the Python shell prompt >>>

If that all works, great, you are set up. If it doesn't come back and 
tell us *exactly* what you did and what was displayed. Copy 'n paste any 
error messages if possible.

HTH
-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list