Writing a Python Program

Peter Hansen peter at engcorp.com
Mon Aug 19 04:02:35 CEST 2002

Ali K wrote:
> I would like to know how to write a program on the interface that opens when
> you click on python.exe.

The question is a little unclear, especially if this has anything
to do with your other question "I would like to know how to write 
a script in the DOS window that opens up when you click on python.exe?"
but I'll try to answer.

If you mean you are clicking on the python.exe file and it opens up an
MS-DOS window and then runs the Python interactive console and gives
you a ">>>" prompt, then the answer is: do NOT write programs in 
this "interface".  This is the interactive prompt, for experimenting
and playing, not for writing programs.  Basically stuff you type
here will be lost when you close the prompt (by typing Ctrl-Z).

What you should do is use a text editor to write the program and
then you should open up an MSDOS prompt (*not* by clicking on python.exe)
and if you have put python.exe in your PATH environment variable
(see recent posts on that topic if you don't know how) then you
can run your program by typing "python myfile.py" (assuming you
saved the file from your text editor with a file name of myfile.py).

Does that help any?


More information about the Python-list mailing list