Run Python program in windows command prompt

To run Python program in windows, I have downloaded and installed python windows installer from http://www.python.org/download/. IDLE is installed by default when I install the python windows installer. So python programs can be written and/or executed using IDLE. Or you can just double click a program to run it. Another way is to run from the windows command prompt. Right click on my computer. Then click Properties > Advanced > Environment Variables. Now edit the 'path' variable. Add the location of python there (in my case it is F:\Python25). If there are more than one variables, each one should be separated by a semicolon (;). For example:
Variable name: path
Variable value: F:\TCWIN45\BIN;F:\Python25

Now you can run / execute a python program from windows command prompt using the following command:
python abc.py

You can also get the python interpreter if you just type python and press enter in the command prompt.

Comments

Gagan said…
hello ,

thanks for the info . i am newbie to python and wanna learn it . can u please tell me some good resources from where i can learn it from basics .
i will appreciate any kind of help .
please contact me at gagandeep4687@gmail.com

thanks

Popular posts from this blog

lambda magic to find prime numbers

Convert text to ASCII and ASCII to text - Python code

Adjacency Matrix (Graph) in Python