471,353 Members | 1,596 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,353 software developers and data experts.

Newbi q: show prog

Sorry for bad subjekt.

I have just started to learn programing, and python sound like a god
choice.
But there is something I do not understand.
I want to write the code in notepad, and then open in a window. I use
win98.
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.
I know that I can write directly in python but that only is good for
testing small bits right.
I hope u can help me get going, cours it all sound exiting making
programs.
Jul 18 '05 #1
9 1488
Christoffer T wrote on 25 Nov 2003 23:27:17 -0800 in : <ef**************************@posting.google.com >

You propably have an error in your code.
To check:
Open a dos window in your program directory
type python file.py
you wil see the output and the window won't close

Sorry for bad subjekt.

I have just started to learn programing, and python sound like a god
choice.
But there is something I do not understand.
I want to write the code in notepad, and then open in a window. I use
win98.
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.
I know that I can write directly in python but that only is good for
testing small bits right.
I hope u can help me get going, cours it all sound exiting making
programs.


Jul 18 '05 #2
[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
Jul 18 '05 #3
Open console first.. go to run and type 'command', that should start the
session then you just cd to your programs directory and do the python
file.py.

On Wed, 2003-11-26 at 02:27, Christoffer T wrote:
Sorry for bad subjekt.

I have just started to learn programing, and python sound like a god
choice.
But there is something I do not understand.
I want to write the code in notepad, and then open in a window. I use
win98.
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.
I know that I can write directly in python but that only is good for
testing small bits right.
I hope u can help me get going, cours it all sound exiting making
programs.

--
James Tanis
jt****@charter.net
Jul 18 '05 #4
Not positive, but I don't believe cmd is provided in windows 98. So he'd
need to use command.com.

On Wed, 2003-11-26 at 03:15, Alan Kennedy wrote:
[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

--
James Tanis
jt****@charter.net
Jul 18 '05 #5
Open console first.. go to run and type 'command', that should start the
session then you just cd to your programs directory and do the python
file.py.

On Wed, 2003-11-26 at 03:07, Rony wrote:
Christoffer T wrote on 25 Nov 2003 23:27:17 -0800 in : <ef**************************@posting.google.com >

You propably have an error in your code.
To check:
Open a dos window in your program directory
type python file.py
you wil see the output and the window won't close

Sorry for bad subjekt.

I have just started to learn programing, and python sound like a god
choice.
But there is something I do not understand.
I want to write the code in notepad, and then open in a window. I use
win98.
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.
I know that I can write directly in python but that only is good for
testing small bits right.
I hope u can help me get going, cours it all sound exiting making
programs.

--
James Tanis
jt****@charter.net
Jul 18 '05 #6
RoT
Let us sit on the grass and tell stories of Christoffer T
Sorry for bad subjekt.

I have just started to learn programing, and python sound like a god
choice.
But there is something I do not understand.
I want to write the code in notepad, and then open in a window. I use
win98.
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.
I know that I can write directly in python but that only is good for
testing small bits right.
I hope u can help me get going, cours it all sound exiting making
programs.


You may need to add a 'raw_input("Press me to end")' command at the end of your script to stop the
window from disappearing to quickly
Jul 18 '05 #7
ch***********@mail.dk (Christoffer T) wrote:
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.


Try "python -i file.py"
This will force python to enter interactive mode after running your
script.
Hit <F6> and <return> to exit.

Alternatively, you can open a command prompt ("cmd.exe") and run
python from there. The python program will exit, but the command
window will stay and show the output of the program.

Amaury.
Jul 18 '05 #8
James Tanis wrote:

Not positive, but I don't believe cmd is provided in windows 98. So he'd
need to use command.com.


Quite correct. No cmd.exe in Win98. That's a WinNT feature.

-Peter
Jul 18 '05 #9
Peter Hansen <pe***@engcorp.com> schreef:
James Tanis wrote:

Not positive, but I don't believe cmd is provided in windows 98. So he'd
need to use command.com.


Quite correct. No cmd.exe in Win98. That's a WinNT feature.


There is a Win95cmd.exe too:
<http://www.neuro.gatech.edu/users/cwilson/cygutils/consize/>

:-)

--
JanC

"Be strict when sending and tolerant when receiving."
RFC 1958 - Architectural Principles of the Internet - section 3.9
Jul 18 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.