Search code examples
pythonpython-3.xpyscript

How can I hide source code from Python file?


I am developing a paid application in Python. I do not want the users to see the source code or decompile it. How can I accomplish this task of hiding the source code from the user, but running the code perfectly with the same performance?


Solution

  • The best way would be to turn your python code into an executable file.


    When u take a look here, there is a nice Tutorial on how to do it:

    1. Install pyinstall via pip3 install pyinstaller
    2. Pack your excecutable with pyinstaller main.py

    There is a lot of options to tweak the output of your application, the docs can be found under https://pyinstaller.org/en/stable/