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

Oracle - Reclaim disk space

Oracle does not release disk space even if you had delete the data or tablespace. If you have enterprise manager, you should use it to  rec...