Beginner's question: executing scripts under Win XP pro

Discussion in 'Python' started by Jean-Claude Garreau, Mar 25, 2006.

  1. Hi,

    I'm a beginner with python 2.4. I use it on Win XP Pro. I have no problems
    with the GUI IDLE, but
    when I copy the instructions in a script file, say 'test.py' and double
    click on the file, I have just a
    console window for a few moments, no output shown and the window closes
    automatically before
    I can do anything else. I am greatful if anyone can help me.

    Please reply also to

    Thanks a lot,

    Jean-Claude
    Jean-Claude Garreau, Mar 25, 2006
    #1
    1. Advertising

  2. Jean-Claude Garreau

    Guest

    there seems to be an error in your script.
    Why don't you execute it directly from IDLE (F5) ? There, you should
    see where the problem is.
    , Mar 25, 2006
    #2
    1. Advertising

  3. Thank you for your answer. I did it. It executes perfectly in IDLE. I made a
    copy/paste
    from IDLE into the 'test.py' and I obseved the behavior I discribed. The
    script is extremely simple
    (it is just a test):

    n=0

    while( n<10 ):

    print n,n*n

    n+=1

    <> a écrit dans le message de news:
    ...
    > there seems to be an error in your script.
    > Why don't you execute it directly from IDLE (F5) ? There, you should
    > see where the problem is.
    >
    Jean-Claude Garreau, Mar 25, 2006
    #3
  4. Jean-Claude Garreau

    Scott Souva Guest

    On Sat, 25 Mar 2006 14:45:34 +0100, "Jean-Claude Garreau"
    <> wrote:

    >Hi,
    >
    >I'm a beginner with python 2.4. I use it on Win XP Pro. I have no problems
    >with the GUI IDLE, but
    >when I copy the instructions in a script file, say 'test.py' and double
    >click on the file, I have just a
    >console window for a few moments, no output shown and the window closes
    >automatically before
    >I can do anything else. I am greatful if anyone can help me.
    >
    >Please reply also to
    >
    >Thanks a lot,
    >
    > Jean-Claude
    >


    Your script may be working properly, but XP simply removes the window
    after the script runs. Here is a simple fix that will stop at the end
    of the script and leave the Command window open:

    print "Hello World"
    raw_input()
    Scott Souva, Mar 25, 2006
    #4
  5. Jean-Claude Garreau

    J Correia Guest

    "Scott Souva" <> wrote in message
    news:...
    > Your script may be working properly, but XP simply removes the window
    > after the script runs. Here is a simple fix that will stop at the end
    > of the script and leave the Command window open:
    >
    > print "Hello World"
    > raw_input()


    That'll work (it waits for input from the user, and, as soon as it
    receives it shuts down the window).

    Another way to do it is instead of doubleclicking on the script,
    open a command prompt window (Start>Run>cmd OR
    Start>Programs>Accessories>Command Prompt) then type
    'python test.py' at the prompt. Now the window stays open
    until you specifically close it and you can rerun the script many times.

    HTH,

    JC
    J Correia, Mar 26, 2006
    #5
  6. Jean-Claude Garreau

    Roger Upole Guest

    "Jean-Claude Garreau" <> wrote in message news:e03hdc$k7v$-lille1.fr...
    > Hi,
    >
    > I'm a beginner with python 2.4. I use it on Win XP Pro. I have no problems with the GUI IDLE, but
    > when I copy the instructions in a script file, say 'test.py' and double click on the file, I have just a
    > console window for a few moments, no output shown and the window closes automatically before
    > I can do anything else. I am greatful if anyone can help me.
    >
    > Please reply also to
    >
    > Thanks a lot,
    >
    > Jean-Claude



    Set the environment variable PYTHONINSPECT.
    It causes the interpreter to halt at the interactive prompt
    after the script runs so you can see the output.

    Roger




    ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
    http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
    ---= East/West-Coast Server Farms - Total Privacy via Encryption =---
    Roger Upole, Mar 28, 2006
    #6
    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. Peter Parker

    Dotnet dev on Win XP Pro

    Peter Parker, Sep 23, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    490
    Peter Parker
    Sep 24, 2003
  2. =?Utf-8?B?Sm9obg==?=

    Running .NET Webpages in Win XP Pro

    =?Utf-8?B?Sm9obg==?=, Apr 14, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    316
  3. Krist
    Replies:
    6
    Views:
    739
    Arne Vajhøj
    May 7, 2010
  4. Wayne Erfling
    Replies:
    0
    Views:
    329
    Wayne Erfling
    Nov 18, 2006
  5. Bradley M. Small

    Works under Win 2000 breaks under XP

    Bradley M. Small, Oct 27, 2003, in forum: ASP General
    Replies:
    4
    Views:
    135
    Bradley M. Small
    Oct 27, 2003
Loading...

Share This Page