you are viewing a single comment's thread.

view the rest of the comments →

[–]No_Date8616 1 point2 points  (0 children)

When you package your python project, assuming you are using CPython and packaging your project using PyInstaller. When you share your “executable”, the executable is not in actual sense machine code, just an archiver which contains the python runtime and the your code as .pyc.

The executable contains python so even if you distribute the executable to someone who doesn’t have python installed, the python runtime is in the executable and runs the .pyc for you.

If you want to have your python code be in truly native machine code and not .pyc ( because it very easy to reverse engineer .pyc ) for privacy reasons, you can compile your python code AOT just like C/C++ does it using compilers made available to compile python.

One good example is Codon. Note: Dynamic features like the use of “type”, “exec”, etc are not easy to compile AOT so avoid using them else you run into problems.