Join my course at Udemy (Python Programming Bible-From beginner to advanced )

Blogger templates

Monday 4 May 2020

Python Interpreter & Programming components

Python Installation Components

Python installation created many components. Among them the main components are the following :
  • Python Interpreter
  • Python libraries


What is Interpreter ?

Interpreter is a software code that acts as a interface between python code and computer hardware. In short python interpreter runs the software code.
  • Python is a interpreter language and python interpreter runs the python code line by line from start to bottom.
  • Python interpreter is invoked on the command line by typing 'python' command.
  • After that '>>>' prompt appear where one can write python code.

How interpreter runs python program ?

There are two aspects to python program execution:
  • Developer version - Developer write python code and runs the python code. Interpreter run the code Python code to bottom. Please note that python does not have compile and link step as it is there for other programming languages like C/C++, JAVA etc. Byte code is python specific interpretation of the code and it reduces the development cycle as developer can just run the code without compile and link step.
  • Python version What interpreter does with Python code ?
    • Byte code creation - Source code is first compiled to byte code. Byte code is low level platform independent byte code that has extension *.pyc. It is created inside __pycache__ directory created in the same place where the python file resides.
    • PVM  - Byte code is then routed to Python virtual machine. PVM ( Python virtual machine) takes the byte code line by line and runs the python code. PVM is big code loop that runs the byte code line by line from start to bottom.




Python Execution Alternatives

Python has many execution alternatives as below :
  • CPython - Standard implementation pf Python. Python can be downloaded from python.org
  • Jython - Jython is Python implementation for integration with JAVA programming language.It compiles the Python source code to Java Byte code that can be run by JAVA Virtual Machine (JVM).
  • IronPython -  It is targeted for .NET platform. Similar to Jython, IronPython conve
  • Stackless - This is re implementation of CPython with support for concurrency.
  • PyPy - This is also reimplementation of CPython with focus on performance. According to pypy.org, PyPy is 4.4 times faster than CPython.

Python Execution Alternatives

Summary

In this article we have seen how Python is installed, how to run the Python and how to intergrate Python with other programming language. Python is still evolving and due to its simplicity one can easily install python and start using Python.




Share:

0 comments:

Post a Comment

Feature Top (Full Width)

Pageviews

Search This Blog