Newbi q: show prog

Alan Kennedy alanmk at hotmail.com
Wed Nov 26 03:15:28 EST 2003


[Christoffer T]
> I have tried to write "python file.py" in run, but it just very fast
> open and close dos window. So what should I do to get to show the
> program.

Open a command prompt window in which to execute your script. This can
be done in multiple ways: perhaps the easiest is to type "cmd.exe"
into the "run" prompt.

When the command prompt window appears, change into the directory
containing your python source, using the "cd" command.

C:\>cd mypythondir

And then execute your source as you tried before.

In order for the command prompt window to find the python interpreter,
you may need to set the environment variable PATH to point at your
python installation. For example

C:\mypythondir>set PATH=C:\python23;%PATH%

As a quick check that this is working, just type "python" at the
command prompt: this should bring up the interactive interpreter. Exit
this interpreter by typing ctrl-Z and pressing the return key.

C:\mypythondir>python
Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ^Z

Your python script should now run just fine:

C:\mypythondir>python file.py
<your output>

but-hey--its-windows-98--anything-could-happen-ly y'rs,

-- 
alan kennedy
-----------------------------------------------------
check http headers here: http://xhaus.com/headers
email alan:              http://xhaus.com/mailto/alan




More information about the Python-list mailing list