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


Groups > comp.lang.python > #36862

atexit handler in IDLE?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.straub-nv.de!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <dreamingforward@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:IDLE': 0.04; 'python': 0.09; 'looked': 0.10; 'def': 0.10; '"this': 0.13; 'steve': 0.13; 'atexit': 0.16; 'east,': 0.16; 'program"': 0.16; 'strange,': 0.16; 'to:name:python list': 0.16; 'wrote:': 0.17; 'jan': 0.18; 'trying': 0.21; 'import': 0.21; 'fairly': 0.21; '15,': 0.23; 'command': 0.24; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'run': 0.28; 'once.': 0.29; 'running.': 0.29; "i'm": 0.29; 'knows': 0.30; 'implement': 0.32; 'print': 0.32; 'idle': 0.33; 'problem': 0.33; 'to:addr :python-list': 0.33; 'program,': 0.34; 'received:google.com': 0.34; 'todo': 0.35; 'received:209.85.220': 0.35; 'subject:?': 0.35; 'received:209.85': 0.35; 'list.': 0.35; 'but': 0.36; 'correctly': 0.37; 'item': 0.37; 'rather': 0.37; 'received:209': 0.37; 'mark': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'think': 0.40; '2013': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=csbFoCtuM6Rn2vyJUitJxmvkzpUiq0rSscRxUHcfz/c=; b=S4eOMmj5GQpB0H5e1iYgiuwcksbD2QsuOuKi+CrGFCp/hVflYeg6Y7ocCqwjxVTkju fSmS7Le+nECw1QQ4uuMT++b0yM+cTzWISIr2F8GqLKBPG3d3wxxDu+dArRSaRntHq/wz ijaKrxp2FBjvAVgd5Uxx5jpbxkJXFiUbMmQLNu35niqKAZvMwahOx5dkJgyAMc2cog0R LEoomime/bDEHZ5JbS1udylqwmBCkPITy91efT/2pvC4mopmIT/jgGisMVjbVq0MiecB sKU6LVol3pWL0Aux2shLU4yYpjHZb2xbv7HmJHkP6pYdn38o/+bVrpKlVF5OvKcxH08Z TFmQ==
MIME-Version 1.0
In-Reply-To <CAMjeLr9nndcSNcbtJq1psruMiLyUffKBhYdG2hOr1XZ1SvfPZA@mail.gmail.com>
References <24E53D14-FD57-4FE2-8763-99149773650B@spvi.com> <CAMjeLr9nndcSNcbtJq1psruMiLyUffKBhYdG2hOr1XZ1SvfPZA@mail.gmail.com>
Date Tue, 15 Jan 2013 11:22:03 -0600
Subject atexit handler in IDLE?
From Mark Janssen <dreamingforward@gmail.com>
To Python List <python-list@python.org>
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.545.1358270533.2939.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1358270533 news.xs4all.nl 6948 [2001:888:2000:d::a6]:57706
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:36862

Show key headers only | View raw


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

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


Thread

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

csiph-web