How Do I Run Python on Windows 10 from Command Line?
Contents

You can access Python in the Command Line by just typing python , python3 , or python3. 7 , python3.

How do I run Python from command line?

To run Python scripts with the python command, you need to open a command-line and type in the word python , or python3 if you have both versions, followed by the path to your script, just like this: $ python3 hello.py Hello World!

How do you run a .py file in Windows Command Prompt?

Type dir and you should see the file Hello.py. To run the program, type python Hello.py and hit Enter. You should see the line Hello World! Congratulations, you have run your first Python program.

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest