py2exe problem

Simon Brunning simon.brunning at
Tue Jun 21 10:37:26 CEST 2005

On 6/21/05, Austin <austin at> wrote:
> I use py2exe to build python program to "aa.exe".
> If this program has a bug, after closed this program, it will show
> "aa.exe.log" in this folder.
> Is there any ways to avoid this log file?

It's probably best just have a try/except at the very top level of
your app that logs the exception the way you want it logged. So, if
you currently have:

if __name__ == '__main__':

you should instead have:

if __name__ == '__main__':
   except exception:
       print >> mylog, exception # or whatever...

You are free to ignore the exception altogether if you want to, but I
promise you, you don't want to. ;-)

Simon B,
simon at,

More information about the Python-list mailing list