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


Groups > comp.lang.python > #36865

Re: atexit handler in IDLE?

References <24E53D14-FD57-4FE2-8763-99149773650B@spvi.com> <CAMjeLr9nndcSNcbtJq1psruMiLyUffKBhYdG2hOr1XZ1SvfPZA@mail.gmail.com> <CAMjeLr8OLAkKDmbkUNxDOY9QM7CAq_fcnFqdu3F8P2F29H0KQw@mail.gmail.com>
From Steve Spicklemire <steve@spvi.com>
Subject Re: atexit handler in IDLE?
Date 2013-01-15 12:38 -0700
Newsgroups comp.lang.python
Message-ID <mailman.549.1358278701.2939.python-list@python.org> (permalink)

Show all headers | View raw


On Jan 15, 2013, at 10:22 AM, Mark Janssen <dreamingforward@gmail.com> wrote:

> 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
> -- 
> http://mail.python.org/mailman/listinfo/python-list

I don't really know how to use this. Is there a detailed todo list somewhere? I did find this tantalizing bit in news.txt, but when I tried to test it (by setting to option to false), I couldn't get it to work. Is there a set of tests for idle that might exercise this option?

----------

What's New in IDLEfork 0.9b1?
=============================

*Release date: 02-Jun-2003*

- Added the delete-exitfunc option to config-main.def.  (This option is not
  included in the Options dialog.)  Setting this to True (the default) will
  cause IDLE to not run sys.exitfunc/atexit when the subprocess exits.

-------------

Thanks!
-steve

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


Thread

Re: atexit handler in IDLE? Steve Spicklemire <steve@spvi.com> - 2013-01-15 12:38 -0700

csiph-web