Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   atexit handler in IDLE? (http://www.velocityreviews.com/forums/t956541-atexit-handler-in-idle.html)

Mark Janssen 01-15-2013 05:22 PM

atexit handler in IDLE?
 
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


All times are GMT. The time now is 07:44 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.