linux python

Python compile to bytecode

To compile a python script to bytecode we can use py_compile module.

Above we try to compile and the bytecode available at __pycache__ folder. We can execute the bytecode as usual. This bytecode cant be used to hide your source code because one can “uncompile” it.