How can I convert my python program with Qt for GUI to .exe file??
I want to make an installation file for my python source code
First part : "How can I convert my python program with Qt for GUI to .exe file??"
You can use PyInstaller, which supports python 2.2 - 2.7 and it has a hook system for including Qt with all dlls and plugins.
You can use also :
Basically all this systems have a definition file to handle and produce the binary package. For instance, esky has a setup.py (which is a distutil file) to produce the package :
from esky import bdist_esky
from distutils.core import setup
setup(name="appname",
version="1.2.3",
scripts=["appname/script1.py","appname/gui/script2.pyw"],
options={"bdist_esky":{"includes":["mylib"]}},
)
Than you can call "python setup.py bdist_esky"
For PyInstaller the thing is pretty different. From console, cd in PyInstaller folder :
python Makespec.py [options] script.py
This produce a spec file with all the options to package your script. You can also modify this file with an editor.
python Build.py script.spec
This analyzes and builds your exe (or os binary equivalent).
Second part : "I want to make an installation file for my python source code"
You have to use NSIS, InnoSetup, BitRock Installer, IzPack or equivalent to produce a platform installer. So you have to take the binary result produced on the first part and package it for os distribution. Almost all the installer systems are thought for Windows systems. Cross platform : Zero Install, IzPack ... If you use IzPack you can have a cross platform installer paying the price of including a jvm.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With