472,950 Members | 2,303 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,950 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 1543
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: mickey | last post by:
I am getting the following error at the line mysql_free_result($result); Warning: Supplied argument is not a valid MySQL result resource in /var/www/html/php/phoneadd.php on line 27 My code...
44
by: MadCrazyNewbie | last post by:
Hey Group, I keep getting a error saying "No Value Given For One Or More Parameters". Unfortunatly I don`t know where this error is coming from:(. Can I run through my code line by line, so I...
1
by: 6655326 | last post by:
Newbi needs a very small help, thank you very much. Hello everyone and thank you very much for your time. I Have a small db for invoicing and on my form (with a subform) there is a CANCEL...
8
by: tvnaidu | last post by:
I am running prog with GDB - throws SIG32, why? @localhost config]# gdb prog GNU gdb Red Hat Linux (5.3.90-0.20030710.40rh) Copyright 2003 Free Software Foundation, Inc. GDB is free software,...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

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.