Windows/DOS: double clicking a .py file
Just
just at xs4all.nl
Mon Sep 9 18:46:54 EDT 2002
[Just]
> > impossible to actually see the exception... Is there a way
> > to keep the dos prompt window in this case?
[Bjorn Pettersen]
> Try something like the following... We've had much success with
> automatically emailing the traceback back to the developer using the
> cgitb module -- you can never trust users to give you good error reports
> <wink> besides the cgitb module provides much more context than the
> standard exceptions... Let me know if you'd like the code...
>
> try:
> your code here
> except:
> import msvcrt, traceback
> traceback.print exc()
> print 'Hit a key to exit'
> while not msvcrt.kbhit():
> pass
Ah, that looks like a good trick, I will try that.
Thanks for your code offer, but in most cases I will have to ask for the
input data anyway, so a simple traceback is good enough for now.
Just
More information about the Python-list
mailing list