HOW TO RUN A PYTHON PROGRAM

If you are using command prompt, instead of integrated development environment, open the cmd.
In Python, our Python scripts have to be processed by another program called the Python interpreter. The interpreter reads your script, compiles it into bytecodes, and then executes the bytecodes to run your program.
We can start the interpreter by typing py in the cmd. Now you are the interpreter is the interactive mode. You can execute all python commands in the interactive mode. But once you leave the interactive mode, all the data is cleared. You can exit the interactive mode by quit()
command

If you got a screen similar to the above, then know that the py
command is recognized, now you can give your Python script to it. You’ll have to give either an absolute or a relative path to the Python script. Consider your Python script is located in your desktop and is named test.py
, navigate to that folder using cd
.

Now type py test.py
