Before we continue with Python Tutorial, let’s discuss on how to execute a Python program from Windows Command Prompt.
Access to Windows command prompt
Run the first Python File
Suppose we have the following Python programs
This program runs fine under Spyder. But to run this program in Command Prompt, type following command
This is the expected result
You may receive the following error message if it is your first time trying this:
“‘python’ is not recognized as an internal or external command,
operable program or batch file.”
This is simply because your application is not in the Path setting. You can fix this problem by referring to yesterday’s tutorial – Python Tutorial A01: How to add python application to Windows Path system Variable? and then reopen the command Prompt again.