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


Groups > comp.lang.python > #36880 > unrolled thread

Re: atexit handler in IDLE?

Started byTerry Reedy <tjreedy@udel.edu>
First post2013-01-15 20:27 -0500
Last post2013-01-15 20:27 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#36880 — Re: atexit handler in IDLE?

FromTerry Reedy <tjreedy@udel.edu>
Date2013-01-15 20:27 -0500
SubjectRe: atexit handler in IDLE?
Message-ID<mailman.559.1358299670.2939.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web