atexit handler in IDLE?
Terry Reedy
tjreedy at udel.edu
Tue Jan 15 20:27:22 EST 2013
On 1/15/2013 7:25 AM, Steve Spicklemire wrote:
> import atexit
> print "This is my program"
>
> def exit_func():
> print "OK.. that's all folks!"
>
> atexit.register(exit_func)
> print "Program is ending..."
If you put () around the strings, it will run the same *and* work in 3.x.
> When I run this on the command line I see:
>
> This is my program
> Program is ending...
> OK.. that's all folks!
>
> When I run this in IDLE I see:
>
> This is my program
> Program is ending...
>
> But the atexit handler is never called. ;-(
I tried in 3.3 idle and get the same.
--
Terry Jan Reedy
More information about the Python-list
mailing list