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

Tomcat - removing server info

Below are the steps to remove Tomcat Server Information 1. Make sure Tomcat is not running 2. Navigate to "Tomcat Installation"...