0

I have always used a mac to write and run python scripts. However, I have a bunch of files on a PC that I need to run a script on. I have never really used a PC and don't know how to run the script.

If I go to the command program on the PC and type in python, nothing happens. How do I find where the python path is in order to get into the python prompt? Also, once I am in the prompt, is the importing of modules the same as in a Unix system?

4
  • 1
    Possible duplicate of How do I run a python program in the Command Prompt in Windows 7? Once you get to the Python prompt, then module loading will work just like in *nix. Commented Feb 14, 2012 at 18:20
  • 1
    "nothing happens"? Nothing at all? CMD.EXE crashes? Blue screen of death? What actually happens? Commented Feb 14, 2012 at 18:25
  • I hope you are using cmd.exe rather than command.com. Commented Feb 14, 2012 at 18:55
  • maybe I am missing something, but...given a correct python installation you only need to double-click the script icon...that's all Commented Feb 14, 2012 at 19:47

2 Answers 2

3

Python isn't added to the system environment's PATH variable by default on windows. You have to either add the path to the directory containing the Python.exe file to the PATH variable, or call python explicitly.

This issue has been addressed in the Python documentation: Python Documentation: # How to run a Python program under windows

Sign up to request clarification or add additional context in comments.

Comments

1

Assuming Python is installed, it is usually placed in a folder prefixed with "Python" and the major/minor version. E.g. C:\Python26

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.