Re: atexit handler in IDLE?

Discussion in 'Python' started by Terry Reedy, Jan 16, 2013.

  1. Terry Reedy

    Terry Reedy Guest

    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
    Terry Reedy, Jan 16, 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:
    442
    Michael Hudson
    Aug 6, 2004
  2. Steve Spicklemire

    atexit handler in IDLE?

    Steve Spicklemire, Jan 15, 2013, in forum: Python
    Replies:
    0
    Views:
    140
    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. Steve Spicklemire

    Re: atexit handler in IDLE?

    Steve Spicklemire, Jan 15, 2013, in forum: Python
    Replies:
    0
    Views:
    148
    Steve Spicklemire
    Jan 15, 2013
  5. David M. Cotter
    Replies:
    1
    Views:
    87
    David M. Cotter
    Jul 30, 2013
Loading...

Share This Page