how to run python files in windows command prompt?
149,095
Solution 1
First set path of python
https://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows
and run python
file
python filename.py
command line argument with python
python filename.py command-line argument
Solution 2
You have to install
Python and add it to PATH on Windows
. After that you can try:
python `C:/pathToFolder/prog.py`
or go to the files directory and execute:
python prog.py
Solution 3
First go to the directory where your python script is present by using-
cd path/to/directory
then simply do:
python file_name.py
Author by