From: Brian D. <deb...@ho...> - 2005-03-08 18:26:22
|
Hi, This is the old e-mail, hope this helps. Regards, Brian ------------------------------------------- message-------------------------------------------------- Which version of py2exe are you running? The "pygame setup.py" script says py2exe-0.3.1 but the latest version is 0.5 and 0.5 won't even run the "pygame setup.py" script. Anyway, I took the minimalStandalone setup.py script and modified it as follows... setup.py: from distutils.core import setup import py2exe setup( name = "Discretas", console = ["Discretas.py"], data_files = [ (".", ["Discretas.rsrc.py", "Graficos.rsrc.py"]) ] ) # should probably copy the Data dir as well... Then I modified the Discretas.py file by adding an import os call and changing on_openBackground to build an explicit path for Graficos.rsrc.py. I don't remember offhand why the module resource file can't be found in library.zip with py2exe. I thought we had found a workaround for that, but it is late and I'll have to discuss that with Thomas to be sure, so my bad on that issue. Anyway, providing an explicit path in the old-style still works assuming the .rsrc.py files are copied to the dist directory. Discretas.py: <snippet> import os class Principal(model.Background): def on_openBackground(self, event): path = os.path.join(self.stack.app.applicationDirectory, \ model.internationalResourceName('Graficos')) self.dibujo = model.childWindow(self, Graficos.Grafico, path) #self.dibujo = model.childWindow(self, Graficos.Grafico) self.dibujo.setPosition((200,50)) I ran the following line to build the exe... python setup.py py2exe --excludes=Image I manually copied the Data dir into the dist directory. The Discretas.exe file starts up fine without errors. ka _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ |