Re: atexit handler in IDLE?

Discussion in 'Python' started by Steve Spicklemire, Jan 15, 2013.

  1. On Jan 15, 2013, at 10:22 AM, Mark Janssen <> wrote:

    > On Tue, Jan 15, 2013 at 6:25 AM, Steve Spicklemire <> 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 oftests 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
    Steve Spicklemire, Jan 15, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Hunter

    tkinter idle handler

    John Hunter, Aug 6, 2004, in forum: Python
    Replies:
    1
    Views:
    440
    Michael Hudson
    Aug 6, 2004
  2. Steve Spicklemire

    atexit handler in IDLE?

    Steve Spicklemire, Jan 15, 2013, in forum: Python
    Replies:
    0
    Views:
    136
    Steve Spicklemire
    Jan 15, 2013
  3. Mark Janssen

    atexit handler in IDLE?

    Mark Janssen, Jan 15, 2013, in forum: Python
    Replies:
    0
    Views:
    147
    Mark Janssen
    Jan 15, 2013
  4. Terry Reedy

    Re: atexit handler in IDLE?

    Terry Reedy, Jan 16, 2013, in forum: Python
    Replies:
    0
    Views:
    140
    Terry Reedy
    Jan 16, 2013
  5. David M. Cotter
    Replies:
    1
    Views:
    86
    David M. Cotter
    Jul 30, 2013
Loading...

Share This Page