To compile a .py file to .pyc you can use the py_compile library. The following will create pyc compiled files from py source.
>>> import py_compile
>>> py_compile.compile('script.py')
One important thing to note is that compiling to .pyc extension only improves the speed in which the files are loaded, no change happens on their execution speed.
No comments:
Post a Comment