Pyinstaller and Pyarmor are two tools that can be used to create GUI tools using Python, or to convert your code into an exe file for distribution.
Pyinstaller turns your python code into an exe file on windows, or an app file on mac, and Pyarmor obfuscates the code before turning it into an exe if you don't want people to know what's in the code.
I had a chance to use it at work, so I'll share it with you along with my personal notes.
Both Pyinstaller and Pyarmor are not cross platform. Therefore, you have to exe and app them on Windows, Mac and Linux respectively.
It is also important to make sure that the OS versions match (I was unable to run the app on Catalina when I made it on Big Sur).
(If you are using the Fastapi framework,
pip install websocket==8.1 was required, due to the use of uvicorn?)
flask ┝ __init__.py └ app.py
For simplicity, let's assume a Flask application like the one above.
If you have installed python or pythol library in your local environment
pyarmor pack -e " --onefile" app.py
- Pyinstaller under /flask,
If you are installing Python and python library under Poetry environment
pyarmor pack -e " --onefile" -x " --exclude venv --no-cross-protection" app.py(need to exclude .venv file)
You need to purchase a license for commercial use.
It is a one-time purchase and costs about $70 (us doller). If I buy one, can I use it for more than one?
There's not much information on Pyarmor, and I had a hard time figuring out how to Build it, especially in a poetry environment!
I hope this helps someone out there!