I have a question about Python projects. I have many projects structured like this:
Project Folder
| main.py
| resources
| | module1.py
| | module2.py
And I'm using this module1.py
and module2.py
in my main.py
application and it all works perfectly fine. But I don't know how to make these modules unreadable. When you see an application, it's usually full of files that you can't open and see what they are doing, that's what I need. For example .dll
files. I don't want people to be able to see what these files are doing.
Edit: I need this because in one of my projects, I have a file of database connection that has to be in another file and I need a way to hide its information.
CodePudding user response:
Open the properties of the file, click on button Advanced and enable encryption for the file. This should help you
CodePudding user response:
You can't, basically. See these answers:
How to obfuscate Python code effectively?
How do I protect Python code from being read by users?
You can compile to bytecode (see first link for details), which makes docstrings and comments unrecoverable, but it can be undone to recover some variable names and the entire structure of your program. If all you need is to make it "kind of annoying" to reverse engineer your code, this might be good enough