Windows Cmd.exe Window

harold fellermann harold.fellermann at upf.edu
Thu Jul 7 15:50:19 CEST 2005


On 07.07.2005, at 15:43, harold fellermann wrote:

> On 07.07.2005, at 15:25, Giles Brown wrote:
>
>> Nah.  You're missing my point.  I only want the command window not to
>> be closed if there is an *exception*.  Picky I know, but there you go.
>
> well, then register raw_input as exit function:
>
>>>> import atexit
>>>> atexit.register(raw_input)
>
> works fine in my terminal. should do in your framework also.

sorry, I did not think. if you want to wait for input _only_ if
an exception occured, your exit function needs to check for the
exception:

 >>> import atexit
 >>>
 >>> def wait_on_exc() :
...     import sys
...     if sys.exc_type :
...         raw_input()
...
 >>> atexit.register(wait_on_exc)

this should do the job, now.

- harold -


--
What if nothing exists and everything is an illusion?
In this case I definitely overpayed my new carpet!
-- Woody Allen




More information about the Python-list mailing list