سؤال

I have been very happy with using the pyinstaller to make windows programs (.exe files]. But I find the debugging phase very time consuming.

I would like to pyinstaller to compile the python code so it will display the error if it crashes.

So far I have made a try and except

try:
    # My code goes here
except Exception as e:
    print "ERROR:"
    print type(e)     # the exception instance
    print e.args

But it is not giving me the full crash log.

هل كانت مفيدة؟

المحلول

Try traceback module, especially print_... functions. Also, try catching BaseExceptions, all exceptions are derived from it, and some aren't derived from Exception.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top