Thursday, December 12, 2013

Python - Compiling Python code from py to pyc

Although Python script does not need to be explicitly compiled before running them, it is possible to manually compile them into bytes code (.pyc) from the script (.py) for better efficiency.

You can read http://effbot.org/pyfaq/how-do-i-create-a-pyc-file.htm to know more about compiling a Python code from py to pyc

Or, you can use the following command to compile a Python source file.

python -c "import py_compile; py_compile.compile('test.py', 'test.pyc')"



No comments:

Post a Comment

Hadoop - How to setup a Hadoop Cluster

Below is a step-by-step guide which I had used to setup a Hadoop Cluster Scenario 3 VMs involved: 1) NameNode, ResourceManager - Host...