It could be a situation when you have to give your Python program to customers, but you don't want to give them Python source code. Here is a solution. Give them Python byte code!
For example, on command line:
>
python -c "import compileall; compileall.compile_file('YourPythonFile.py')"
>
python -c "import compileall; compileall.compile_dir('YourFolder/', force=True)"
Or, you can put the
compiling action in source code
import compileall
compileall.compile_dir('YourFolder/', force=True)
No comments:
Post a Comment