Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #36880

Re: atexit handler in IDLE?

From Terry Reedy <tjreedy@udel.edu>
Subject Re: atexit handler in IDLE?
Date 2013-01-15 20:27 -0500
References <24E53D14-FD57-4FE2-8763-99149773650B@spvi.com>
Newsgroups comp.lang.python
Message-ID <mailman.559.1358299670.2939.python-list@python.org> (permalink)

Show all headers | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: atexit handler in IDLE? Terry Reedy <tjreedy@udel.edu> - 2013-01-15 20:27 -0500

csiph-web