Can compiled Python code from Panda3d be read?

Hi, I am a new programmer interested in learning to use Panda3d. I might want to make some games eventually but I have been reading that it is possible to reverse engineer source code from compiled Python programs, which can contribute to it not being desirable from a commercial project standpoint. There are some ways to diminish this but it seems to be a very common feature of Python. I have been wondering, do Panda3d executables have this same feature, or does the code get compiled into a more difficult to reverse-engineer format? Thank you :slight_smile:

The default packp3d, pdeploy tools for Panda3D will turn your python code into bytecode, pack it into a read-only multifile (p3d) and then pack that into a binary file (.exe or suchlike). It’s not trivial to get any usable code back from a game deployed in this way.
If that’s not enough then you can use Nuitka ( to compile your python code into a C++ extension module. This will not only make it a wee bit faster but also very hard to decompile and even harder to get python code back from it.

Either way if someone with the right skills, knowledge and time will want to crack your code - he or she will. Look at big companies and how much money and effort they put into securing their products and still a pirated version of windows appears within 24h of release.

The thing is… do you really want to hide your code that much? Many games are enjoyable because you can mod them, letting players tinker with your game may be a good thing. Think about it.

Thank you for a very informative reply :slight_smile: You have a good point about the modding.

You could also use Cython.