

In interactive mode, the python code is written and run line by line in a sequential manner.To enter into interactive mode, open Command Prompt and type ‘python’ and press Enter. Interactive mode is the method to type and run python code in command line. This will open a console box at the bottom and output will be shown there. The second way to run is, Right click and select ‘ Run File in Python Console’ option. To run, Click on the Green Play Button at the top right corner of the IDE.

To run a python program on an IDE like P圜harm, we need to follow the given steps −Ĭreate a new python file and save it with some name, say “hello.py”.You don’t need to specify the extension as it will pick it automatically.Īfter writing the required code in the python file, we need to run it. To run it on command line, type the following − python hello.py Run On IDE (P圜harm)

Let us suppose, we have a python script saved with the name ‘hello.py’. In the cmd, type keyword ‘python’ followed by the name of the file with which you saved the python script. After saving the python script, we can run it from the Command Line. The python script file is saved with ‘.py’ extension. To run the program, go to Run > Run Module or simply click F5. To run a python program on IDLE, follow the given steps − Running a python program is quite an easy task. On running the program, we can check whether the code is written is correct and produces the desired output. After writing the code, we need to run the code to execute and obtain the output.
