Wednesday, 6 January 2016

Python Development Process

Python Development Process:

There is no distinction between the development and execution environments. In other words, the compiler is always right there at runtime and is part of the system that runs the program. All we have in Python is runtime. There is no initial compile-time phase at all and everything happens as the program is running.

This even includes operation such as the creation of functions and classes and the linking of modules. Such events occur before execution in more static languages, but in Python, they happen as programs execute.

This adds a more dynamic flavor to the Python - it is often very convenient for Python programs to construct and execute other Python programs at runtime. The eval and exec built-ins, for example, accept and run strings containing Python program code.

This structure is why Python lends itself to customization. Because Python code can be changed on the fly, users can modify the Python parts of a system onsite without needing to compile the entire system's code.


Frozen Binaries:

It is possible to turn our Python programs into true executables. This is known as frozen binaries. Frozen binaries bundles together the byte code of our program files, along with the PVM interpreter and any Python support files our program needs, into a single package, a single binary executable program like .exe file on Windows. In other words, the byte code and PVM are merged into a single component.

Frozen binaries are not the same as the output of a true compiler. They run byte code through a virtual machine. Frozen binaries are not small because they contain PVM, but they are not unusually large either.

Three primary systems are capable of generating frozen binaries:

py2exe for Windows.
PyInstaller is similar to py2exe but also works on Linux and Unix.
freeze.

No comments: