Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'programmer': 0.03; 'tkinter': 0.07; 'method,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'gui': 0.12; 'thread': 0.14; 'loop.': 0.16; 'loops': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'unsafe': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'work,': 0.20; 'seems': 0.21; 'header:User-Agent:1': 0.23; 'first,': 0.26; 'second': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'besides': 0.30; "i'm": 0.30; 'noted': 0.31; 'knows': 0.35; 'done.': 0.35; 'but': 0.35; 'too': 0.37; 'window': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'new': 0.61; 'email addr:gmail.com': 0.63; 'periodically': 0.68 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dave Angel Subject: Re: tkinter redraw rates Date: Wed, 17 Jul 2013 06:07:22 -0400 References: <17c2ef71-ee2d-4229-9731-e0d54a0997cb@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 174.32.174.30 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1374055664 news.xs4all.nl 15974 [2001:888:2000:d::a6]:58278 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:50783 On 07/16/2013 11:04 PM, fronagzen@gmail.com wrote: > Noted on the quoting thing. > > Regarding the threading, well, first, I'm not so much a programmer as someone who knows a bit of how to program. > > And it seems that the only way to update a tkinter window is to use the .update() method, which is what I was experimenting with. Start up a new thread that just loops the .update() with a 1ms sleep until the download is done. It seems to work, actually. > update() is to be used when it's too awkward to return to mainloop. In my second approach, you would periodically call it inside the processing loop. But unless tkinter is unique among GUI's, it's unsafe to do that in any thread besides the GUI thread. -- DaveA