•Installation
•Execution of program
Python Virtual Machine
•Python file first get compiled to give us byte code and that byte code is interpreted into machine language.
•This is performed by PVM.
•Execution:
Installation of Python
•Go to: www.python.org/downloads
•Click the “download python” button, save it and run.
•Follow the step by step process of installation wizard.
Installation of Python Contd..
•An Open File – Security Warning pop-up window will appear.
•Click Run. A Python 3.7.x Setup pop-up window will appear.
Installation of Python Contd..
•Ensure that the Install launcher for all users (recommended) and the Add Python 3.7 to PATH checkboxes at the bottom are checked.
•Highlight the Install Now (or Upgrade Now) message, and then click it.
Installation of Python Contd..
•Click the Yes button.
•A new Python 3.7.x Setup pop-up window will appear with a Setup Progress message and a progress bar.
Installation of Python Contd..
•Pop-up window will appear with a Setup was successfully message.
•Click the Close button.
•Python should now be installed.
Executing a Python Program
There are three ways of executing a python program.
Using Python’s Command line window
Using Python IDLE graphics window
Directly from System prompt
The first two are called interactive modes where we can type the program one line at a time and the PVM executes it immediately.
The last one is called non-interactive mode where the PVM executes program after typing the entire program.
Using Python’s Command line window
Open the Python command line window
>>> (symbol) which is called Python prompt
Type program at the >>> prompt
After typing the last line and pressing enter button, it display the result.
After that, type exit() or quit() to close Python command prompt.
Using Python IDLE graphics window
Click the Python’s IDLE (Integrated Development Environment) window
Type program :
To terminate the IDLE window, type exit() or quit(). It will display a message as to kill the program or not
Directly from System prompt
Open a text editor and type the program
Save the program by clicking File à Save As, type the program name with extension .py
Open the command prompt
Go to that directory where the program is saved
Execute the program by calling the python command
c:\xyz>python pro_name.py