From: Greg M. <gtm...@gm...> - 2008-07-06 08:57:31
|
Hi Michael, That's exactly what was happening. Turns out that the processing module has a function to handle parsing sys.argv for 'frozen' applications: if __name__ == '__main__': processing.freezeSupport() And now everything works great. :) Thx for the pointer, I'm not sure I ever would've stumbled up on that otherwise. -Greg On Fri, Jul 4, 2008 at 5:19 AM, Michael Foord <fuz...@vo...> wrote: > Greg MacDonald wrote: >> I'm having an issue with py2exe and python's processing module (It's >> like the threading module but spawns processes instead of threads.) >> For each process I spawn, an entirely new instance of my app runs when >> I start the executable. Everything runs fine from plain vanilla >> python. >> >> Is there an option or setting I've missed? >> > > The processing module (what used to be called multiprocessing right?) > launches new threads with the Python executable. It does this by > locating the Python executable from sys.executable. > > In py2exe, sys.executable points to your application. > > To get round this, put some logging in to see what command line > arguments processing is calling the executable with (print sys.argv) and > put some special casing to handle that case. It will probably be with > '-c' passing some code to run as a string - which your program will need > to exec. > > Michael Foord > >> Thx. >> >> -Greg >> >> ------------------------------------------------------------------------- >> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! >> Studies have shown that voting for your favorite open source project, >> along with a healthy diet, reduces your potential for chronic lameness >> and boredom. Vote Now at http://www.sourceforge.net/community/cca08 >> _______________________________________________ >> Py2exe-users mailing list >> Py2...@li... >> https://lists.sourceforge.net/lists/listinfo/py2exe-users >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > http://www.theotherdelia.co.uk/ > > > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source project, > along with a healthy diet, reduces your potential for chronic lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > _______________________________________________ > Py2exe-users mailing list > Py2...@li... > https://lists.sourceforge.net/lists/listinfo/py2exe-users > |