How to compile python source files
Delivering python sources
Python sources are script files which are readable. Sometimes it's not necessary to expose the source code to the customers are we may want to intentionally protect our sources. In that cases we can compile the software and deliver it as a .pyc file
How to compile
bala@IND68FL4H2-L:~/reflash-tools/bin$ ls
genpack-flash.py genpack-orch.py genpack-usb.py swpart.py
bala@IND68FL4H2-L:~/reflash-tools/bin$ python -m compileall .
Listing . ...
Compiling ./genpack-flash.py ...
Compiling ./genpack-orch.py ...
Compiling ./genpack-usb.py ...
Compiling ./swpart.py ...
Listing . ...
Compiling ./genpack-flash.py ...
Compiling ./genpack-orch.py ...
Compiling ./genpack-usb.py ...
Compiling ./swpart.py ...
bala@IND68FL4H2-L:~/reflash-tools/bin$ ls
genpack-flash.py genpack-flash.pyc genpack-orch.py genpack-orch.pyc genpack-usb.py genpack-usb.pyc swpart.py swpart.pyc
genpack-flash.py genpack-flash.pyc genpack-orch.py genpack-orch.pyc genpack-usb.py genpack-usb.pyc swpart.py swpart.pyc
References
https://stackoverflow.com/questions/17590889/recompile-all-python-files-in-directory/17590925
Comments
Post a Comment