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


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

atexit handler in IDLE?

Started byMark Janssen <dreamingforward@gmail.com>
First post2013-01-15 11:22 -0600
Last post2013-01-15 11:22 -0600
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

  atexit handler in IDLE? Mark Janssen <dreamingforward@gmail.com> - 2013-01-15 11:22 -0600

#36862 — atexit handler in IDLE?

FromMark Janssen <dreamingforward@gmail.com>
Date2013-01-15 11:22 -0600
Subjectatexit handler in IDLE?
Message-ID<mailman.545.1358270533.2939.python-list@python.org>
On Tue, Jan 15, 2013 at 6:25 AM, Steve Spicklemire <steve@spvi.com> wrote:
> I'm trying to get this program, which works on the command line, to run correctly in the IDLE environment:
>
> import atexit
>
> print "This is my program"
>
> def exit_func():
>     print "OK.. that's all folks!"
>
> atexit.register(exit_func)
>
> print "Program is ending..."

You know, I think I looked at this problem once.  It was rather
strange, but I think you need to create a tempfile, so that Python
knows that IDLE is running.   There's an item for this in IDLE's TODO
list.  I was going to implement it, which is fairly east, but never
got to it.

mark

[toc] | [standalone]


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


csiph-web