Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Newbi q: show prog

Reply
Thread Tools

Newbi q: show prog

 
 
Christoffer T
Guest
Posts: n/a
 
      11-26-2003
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.
 
Reply With Quote
 
 
 
 
Rony
Guest
Posts: n/a
 
      11-26-2003
Christoffer T wrote on 25 Nov 2003 23:27:17 -0800 in : <(E-Mail Removed) >

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.


 
Reply With Quote
 
 
 
 
Alan Kennedy
Guest
Posts: n/a
 
      11-26-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
 
Reply With Quote
 
James Tanis
Guest
Posts: n/a
 
      11-26-2003
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 : <(E-Mail Removed) >
>
> 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
http://www.velocityreviews.com/forums/(E-Mail Removed)


 
Reply With Quote
 
James Tanis
Guest
Posts: n/a
 
      11-26-2003
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
(E-Mail Removed)


 
Reply With Quote
 
James Tanis
Guest
Posts: n/a
 
      11-26-2003
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
(E-Mail Removed)


 
Reply With Quote
 
RoT
Guest
Posts: n/a
 
      11-26-2003
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


 
Reply With Quote
 
Amaury Forgeot d'Arc
Guest
Posts: n/a
 
      11-26-2003
(E-Mail Removed) (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.
 
Reply With Quote
 
Peter Hansen
Guest
Posts: n/a
 
      11-26-2003
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
 
Reply With Quote
 
JanC
Guest
Posts: n/a
 
      11-28-2003
Peter Hansen <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Newbi Q: Recursively reverse lists but NOT strings? Victor B. Gonzalez Python 5 10-17-2007 12:19 PM
newbi question on python rpc server, how it works? krishnakant Mane Python 3 03-29-2007 05:55 AM
a newbi problem: can't find complete python curses library krishnakant Mane Python 2 11-03-2006 06:32 AM
Starting and stopping a prog. from another prog. andoni.oconchubhair@ie.fid-intl.com Java 1 10-22-2006 10:43 PM
Newbi converting home video Rene DVD Video 1 06-23-2005 08:00 PM



Advertisments