Thanks, I had completely missed the module traceback... I'll use traceback.print_exc(), it seems the most straightforward way. The only flaw is that the traceback starts in the method where i catch the exception and not from "__main__", but I guess it can't be helped.