Reputation: 1456
All,
I have developed a python program that is controlled by a GUI developed in PyQt. This GUI file, which was later converted to python (using pyuic4) implements about 4 other python files including a "main file". How could I convert all of these into one "double - clickable" .exe file? NOTE: My program and GUI both work when I run my main file.
Regards
Upvotes: 3
Views: 8851
Reputation: 6510
You can use cxFreeze to build executable: http://cx-freeze.sourceforge.net/.
However, there will be a lot of files, but you could use your app standalone.
Also, you should be accurate in module imports to reduce size of the build. My scripts (about 200KB) were built in 200MB monster (used SciPy and Qt4).
Example build scripts is attached:
#coding=utf-8
from cx_Freeze import setup, Executable
includes = ["atexit"]
buildOptions = dict(
create_shared_zip=False,
append_script_to_exe=True,
includes=includes
)
executables = [
Executable(
script='main.py',
targetName='projectname.exe',
base="Win32GUI" # THIS ONE IS IMPORTANT FOR GUI APPLICATION
)
]
setup(
name="ProjectName",
version="1.0",
description="",
options=dict(build_exe=buildOptions),
executables=executables
)
Upvotes: 4
Reputation: 7900
There are many tools to convert Python applications to executable files. I recommend to use cx_Freeze: http://cx-freeze.readthedocs.org/en/latest/
Upvotes: 0