473,395 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 1564
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.