Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

problem running python files from windows command line

Options
  • 08-06-2009 1:02pm
    #1
    Registered Users Posts: 872 ✭✭✭


    Hi,

    I am trying to run a python file from the command line. When i try and do this the file just opens up in notepad instead of executing.

    My path environment variable has - C:\Python26;C:\Python26\Scripts
    My pathext variable has - .PY;.PYW

    Anyone any ideas why this is happening ?

    Thanks


Comments

  • Registered Users Posts: 85 ✭✭slavigo


    Hi,

    I'm afraid I'm not familiar with the "PATHEXT" environment variable.
    So maybe I'm misunderstanding the problem you are having.

    Have you an example of the command that you are running?

    In general you need to run the python interpreter and pass in a python file.
    I tend to add C:\Python26 to my PATH environment variable as it contains the python executable "python.exe".
    Then the command to run your script looks like this:
    python foo.py

    Otherwise try:
    C:\Python26\python foo.py

    Hope this helps.
    Dave.


Advertisement