As a python beginner, one of things you should know is how to run python script. In this tutorial, we will introduce you the way to run python script in windows 10 command prompt.
To run python script in windows 10 system, you should install python first. We recommend you to install python using anaconda, which can help you to void some settings when using python and can manage python libraries easily.
Run python script in command prompt
After having installed python, we can run python script by windows command prompt.
We can open command prompt and run python script like:
Where python_file.py is the absolute path of a python file. For example:
In this example, we will run python script test.py, which is in the directory d:\example.
We also can locate to the d:\example and run test.py.
cd d:\example d: python test.py
You will find that running python script in windows command prompt is very easy.