Newbi q: show prog

Discussion in 'Python' started by Christoffer T, Nov 26, 2003.

  1. 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.
     
    Christoffer T, Nov 26, 2003
    #1
    1. Advertising

  2. Christoffer T

    Rony Guest

    Christoffer T wrote on 25 Nov 2003 23:27:17 -0800 in : <>

    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.
     
    Rony, Nov 26, 2003
    #2
    1. Advertising

  3. Christoffer T

    Alan Kennedy Guest

    [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
     
    Alan Kennedy, Nov 26, 2003
    #3
  4. Christoffer T

    James Tanis Guest

    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 : <>
    >
    > 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
     
    James Tanis, Nov 26, 2003
    #4
  5. Christoffer T

    James Tanis Guest

    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
     
    James Tanis, Nov 26, 2003
    #5
  6. Christoffer T

    James Tanis Guest

    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
     
    James Tanis, Nov 26, 2003
    #6
  7. Christoffer T

    RoT Guest

    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
     
    RoT, Nov 26, 2003
    #7
  8. (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.
     
    Amaury Forgeot d'Arc, Nov 26, 2003
    #8
  9. Christoffer T

    Peter Hansen Guest

    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
     
    Peter Hansen, Nov 26, 2003
    #9
  10. Christoffer T

    JanC Guest

    Peter Hansen <> 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
     
    JanC, Nov 28, 2003
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. -intl.com
    Replies:
    1
    Views:
    371
    Martin Gregorie
    Oct 22, 2006
  2. krishnakant Mane
    Replies:
    2
    Views:
    375
    Bill Pursell
    Nov 3, 2006
  3. krishnakant Mane
    Replies:
    3
    Views:
    333
    krishnakant Mane
    Mar 29, 2007
  4. Victor B. Gonzalez
    Replies:
    5
    Views:
    304
    Bruno Desthuilliers
    Oct 17, 2007
  5. paul
    Replies:
    6
    Views:
    313
    Bruno Desthuilliers
    Oct 16, 2007
Loading...

Share This Page