[Tutor] (no subject)

Lie Ryan lie.1296 at gmail.com
Mon Nov 3 11:52:51 CET 2008

On Sat, 01 Nov 2008 06:17:06 -0500, otu wrote:

> Dear Friends,
> I have just started learning python programming. I have no previous
> programming knowledge.
> I am presently using Python 2.6 windows version. I am struggling with
> how to enable executable files. I copied the ff program on idlle
> non-interactice and run it.
> the_world_is_flat =1
> if the_world_is_flat:
> 	print"Be careful not to fall off"
> The result came out on the interactive window. I saved this as
> "example.py" on the desktop. The python icon appears on the the desktop
> alright.  When I attempt to run it by double clicking the icon, only a
> black DOS window flashes.  I know I am doing something seriously wrong.
> What is it?
> Regards,
> Bennedy.

There are two ways to answer your problem. 

First, you open the command prompt (Start > Run > cmd) then change 
directory (cd) to where your script is located (e.g. cd C:/scripts/
test.py). Then run the script with "python <scriptname>" (including 
the .py extension)

Second alternative, which is usually easier if you're not comfortable 
with working in command prompt, is to use an IDE (Integrated Development 
Environment), python ships with an IDE called IDLE by default.

More information about the Tutor mailing list