[python-win32] Bit of a strange one using py2exe

Jacob Kruger jacobk at mailzone.co.za
Mon May 23 10:09:45 CEST 2011


Not 100% sure if this is for real, but almost seemed like when I tried out making use of py2exe to build an executable from a python script of mine, it didn't accept the use of a string value of exit in single quotes after it had built the executable, as in, something like the following, that would work fine in the normal interpreter rendition, now told me something along the lines of 'exit' is not defined:

if act == 'exit':


If I switched that over to using double quotation marks, it then seemed happy enough:

if act == "exit":

I'm guessing that the single quoted version is being handled slightly differently, and that there's something to do with the keyword, exit, or something since I am generally making use of single quotes/apostrophe's for various other string values, without those instances seeming to cause issues?

Also, going to look through any sort of documentation can find, but, off-hand, does py2exe need you to in fact include all code etc. in one file? 

Just asking since am currently importing some functions from an external file, but had to in fact copy that code into the main file when trying this out as such, or else at runtime it tells me it can't find the other module to import a function from.

Stay well

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'



More information about the python-win32 mailing list