0

With "auto py to exe" I normally compile .py to .exe. However, my program was decompiled and published. I acted quickly and up to 3/4 people downloaded it. Back to the topic... How could I compile a .py program into .exe so that it cannot be decompiled?

src_guy
  • 19
  • 2
  • 3
    Does this answer your question? [How do I protect Python code?](https://stackoverflow.com/questions/261638/how-do-i-protect-python-code) – python_user Jan 29 '21 at 13:58

1 Answers1

0

Use Cython to generate .pyd file and then import your .pyd file (like a normal python file) in a normal python file (.py). Doing that when you use pyinstaller only your normal py file will be accessible if your exe is open.

ex:

myScript.py

def main():
  print("Hello")

Use cython on myScript.py to generate a .pyd file

And then a normal python file to import your .pyd file: runMyScript.py

import myScript #the .pyd file

#run your script
myScript.main()

Then use pyinstaller to package your app

Manu N.
  • 26
  • 1
  • Hey ! Sorry to reply so late ... Can you instruct me on how to generate the .pyd file. I can't do this. BTW I think I installed Cython correctly – src_guy Jan 30 '21 at 21:40