Hi Jorgen,
Jorgen Bodde wrote:
Hi all,
I am writing an app that has a wxPython front end, but also a GUI-less
back end. On windows I would like to have the console and GUI both
compiled to one dir. The problem however is that calling two setup()
functions in a py2exe session, makes it overwrite the "library.zip"
file in which all the files are located for each individual exe. Is
there a way to generate two exe's in one directory with py2exe ?I can't generate two seperate dirs because:
- The overhead will be 10+ Mb for the user
- Shared files are needed in both appsI was thinking that perhaps I could merge library.zip from the console
and the GUI, I did some investigation and all "imported" modules are
binary compatble.Did anyone succeed in attempting what I want?
Just have one setup.py generating both exe's, some code snippets from my setup.py:
# options for py2exe
options = {"py2exe": {"compressed": 1,
"optimize": 2,
"packages": ["encodings",
"kinterbasdb",
"pytz.zoneinfo.UTC", "matplotlib.numerix",
"email",
],
"excludes": ["MySQLdb", "Tkconstants", "Tkinter", "tcl",
"ormUnicode.adapters.pgsql", "ormUnicode.adapters.mysql",
],
"dll_excludes": ["tcl84.dll", "tk84.dll", "wxmsw26uh_vc.dll"]
}
}
zipfile = r"lib\library.zip"
exe1 = MetaBase(
script = "script1.py",
other_resources = [(RT_MANIFEST, 1, manifest_template % dict(prog="whatever name"))],
icon_resources = [(1, r"images/exe1.ico")],
dest_base = r"prog\exe1")
exe2 = MetaBase(
script = "script2.py",
other_resources = [(RT_MANIFEST, 1, manifest_template % dict(prog="whatever name 1"))],
icon_resources = [(1, r"images/exe2.ico")],
dest_base = r"prog\exe2")
setup(
classifiers = ["Copyright:: whoever",
...
windows = [exe1, exe2],
#console = [exe1],
options = options,
zipfile = zipfile,
... ]
)
Werner