To distribute your app, you want to have a single executable program instead of source code. This is easier than giving users many Python files.
Why? A user can start your app with a single click. On Windows it’s a .exe. On Mac OS X it’s a .dmg
Related Course: Create GUI Apps with Python PyQt5
Make Executable
Install Toolchain
You can use fbs to create a program that can be run.
1 | sudo apt3 install python3-venv |
Then you’ll be asked for name of the app and the author
1 | App name [MyApp] : hello |
Take a look at the file /venv/src/main/python/main.py
. That’s the source code for your program.
Type fbs run
to start the program.
Create the Executable
You start apps from a binary. On Windows thats a .exe, on Mac that’s a .dmg
To make a standalone executable type
fbs freeze
.
It then creates the program in target/
. If you named the app hello, it’s target/hello/hello
.
Setup
Software is always installed using an installer. You can create your own installer with the command fbs installer
.
On Windows and Mac this will create a graphical setup program (setup wizard).
On Linux it creates a package file (.deb, .rpm), that can be installed with the package manager.
If you are new to Python PyQt, then I highly recommend this book.