On 6/21/05, Austin <[EMAIL PROTECTED]> 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__':
   main()

you should instead have:

if __name__ == '__main__':
   try:
       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. ;-)

-- 
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to