How to run Python script on WindowXP

Discussion in 'Python' started by Yunxian Mak, Aug 1, 2003.

  1. Yunxian Mak

    Yunxian Mak Guest

    Dear Sir/Madam,

    I'm doing my PhD in APAF and I installed Python 2.2 interpreter in
    WindowNT before and it worked OK on my old computer. However, our
    company has upgraded the systems to WindowXP recently. I installed
    Python2.2.3, which includes IDLE (Python GUI), Module Docs, Python
    (command line) and Python Manuals, on my new computer. I can open my
    Python code from IDLE (Python GUI), but I don't know how to run it. If
    you could please tell me whether the Python interpreter compatible to
    WindowXP and how to run the Python script on WindowXP, I'll be much
    appreciated. Thank you very much again.

    Best regards,

    Yunxian Mak
    Yunxian Mak, Aug 1, 2003
    #1
    1. Advertising

  2. Yunxian Mak

    John Roth Guest

    How to run Python script on WindowXPFunny, I works for me. There are two
    parts to
    the solution. First, check if the Python library is in your path. If
    it isn't, you'll get an error that says something like "not an executable
    or script."

    Go to Control Panel -> System -> Advanced -> Environment Variables,
    and you'll be able to set the path properly.

    Outside of that, your command needs to be: "python <yourscript>.py
    <parameters>"
    (without the quotes, obviously.) For example:

    python froznitz.py foobar galoshes

    I find that a command file (.cmd) to set the
    python path first helps. Python, for some reason, does not assume the .py,
    you
    have to specify it.

    John Roth

    [original post]
    "Yunxian Mak" <> wrote in message
    news:...
    Dear Sir/Madam,
    I'm doing my PhD in APAF and I installed Python 2.2 interpreter in WindowNT
    before and it worked OK on my old computer. However, our company has
    upgraded the systems to WindowXP recently. I installed Python2.2.3, which
    includes IDLE (Python GUI), Module Docs, Python (command line) and Python
    Manuals, on my new computer. I can open my Python code from IDLE (Python
    GUI), but I don't know how to run it. If you could please tell me whether
    the Python interpreter compatible to WindowXP and how to run the Python
    script on WindowXP, I'll be much appreciated. Thank you very much again.
    Best regards,
    Yunxian Mak
    John Roth, Aug 1, 2003
    #2
    1. Advertising

  3. How to run Python script on WindowXPHI,

    make a .bat or .cmd file with following lines:
    REM START of FILE
    assoc .py=Python.File
    assoc .pyc=Python.CompiledFile
    assoc .pyw=Python.NoConFile

    ftype Python.File=C:\Python23\python.exe "%%1" %%*
    ftype Python.CompiledFile=C:\Python23\python.exe "%%1" %%*
    ftype Python.NoConFile=C:\Python23\pythonw.exe "%%1" %%*

    rem this should be done in the system settings
    set PATHEXT=%PATHEXT%;.py;.pyc;.pyw
    rem END of FILE

    greetings Leopold

    "Yunxian Mak" <> wrote in message news:...
    Dear Sir/Madam,

    I'm doing my PhD in APAF and I installed Python 2.2 interpreter in WindowNT before and it worked OK on my old computer. However, our company has upgraded the systems to WindowXP recently. I installed Python2.2.3, which includes IDLE (Python GUI), Module Docs, Python (command line) and Python Manuals, on my new computer. I can open my Python code from IDLE (Python GUI), but I don't know how to run it. If you could please tell me whether the Python interpreter compatible to WindowXP and how to run the Python script on WindowXP, I'll be much appreciated. Thank you very much again.

    Best regards,

    Yunxian Mak
    Leopold Faschalek, Aug 1, 2003
    #3
    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. Replies:
    5
    Views:
    472
  2. Replies:
    1
    Views:
    334
    Larry Bates
    Dec 14, 2006
  3. sophie_newbie

    Error when python script run as cgi script

    sophie_newbie, Oct 21, 2007, in forum: Python
    Replies:
    3
    Views:
    597
    Dennis Lee Bieber
    Oct 22, 2007
  4. Replies:
    1
    Views:
    472
    Gabriel Genellina
    Apr 7, 2008
  5. Replies:
    9
    Views:
    970
    Paddy O'Loughlin
    Feb 27, 2009
Loading...

Share This Page