2

I want to run a python file in my command prompt but it does nothing. These are the screen shots of my program i am testing with and the output the command prompt gives me. enter image description here

enter image description here

Abdullah Bilal
  • 393
  • 1
  • 6
  • 12

3 Answers3

20

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

Community
  • 1
  • 1
Benjamin
  • 2,257
  • 1
  • 15
  • 24
4

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
Marten
  • 117
  • 1
  • 7
2

First go to the directory where your python script is present by using-

cd path/to/directory

then simply do:

python file_name.py
V.Khakhil
  • 285
  • 5
  • 22