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


Groups > comp.lang.python > #77336

Re: Sequencing images using tkinter?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!zen.net.uk!dedekind.zen.co.uk!news.stack.nl!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.010
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'tkinter': 0.07; 'exit': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:using': 0.09; 'def': 0.12; 'function?': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'seconds.': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'header:X-Complaints-To:1': 0.27; 'function': 0.29; "doesn't": 0.30; 'invoke': 0.31; 'schedules': 0.31; 'problem': 0.35; 'subject:?': 0.36; 'to:addr:python-list': 0.38; 'itself': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'tell': 0.60; 'times': 0.62; 'email addr:gmail.com': 0.63; 'skip:n 10': 0.64; 'skip:m 50': 0.68; 'limit': 0.70; 'introduce': 0.78; 'indefinitely': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Peter Otten <__peter__@web.de>
Subject Re: Sequencing images using tkinter?
Date Sat, 30 Aug 2014 23:14:10 +0200
Organization None
References <dcff98af-47cd-4dbc-9fa1-02dc6813df81@googlegroups.com> <7eedecff-7ff3-43f5-ae47-7283f115cad2@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding 7Bit
X-Gmane-NNTP-Posting-Host p57bdad69.dip0.t-ipconnect.de
User-Agent KNode/4.13.3
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 <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.13654.1409433267.18130.python-list@python.org> (permalink)
Lines 29
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1409433267 news.xs4all.nl 2913 [2001:888:2000:d::a6]:48742
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:77336

Show key headers only | View raw


theteacher.info@gmail.com wrote:

> How do you exit from this function?
> 
> def next_image():
>     myLabel.config(image=random.choice(monster_images))
>     # tell tkinter to invoke next_image() again after 200 miliseconds

You misunderstand. The problem with the function is not that it doesn't 
exit, it's just that with

>     root.after(200, next_image)

it schedules itself to be reinvoked by tkinter after 200 seconds. If you 
want to limit that to 10 times instead of indefinitely you can introduce a 
counter:

n = 10
def next_image():
    global n

    myLabel.config(image=random.choice(monster_images))
    n -= 1
    if n > 0:
        root.after(200, next_image)
              


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


Thread

Sequencing images using tkinter? theteacher.info@gmail.com - 2014-08-30 08:54 -0700
  Re: Sequencing images using tkinter? Terry Reedy <tjreedy@udel.edu> - 2014-08-30 15:52 -0400
  Re: Sequencing images using tkinter? Peter Otten <__peter__@web.de> - 2014-08-30 21:54 +0200
  Re: Sequencing images using tkinter? theteacher.info@gmail.com - 2014-08-30 13:11 -0700
  Re: Sequencing images using tkinter? theteacher.info@gmail.com - 2014-08-30 13:27 -0700
    Re: Sequencing images using tkinter? "Albert Visser" <albert.visser@gmail.com> - 2014-08-30 22:49 +0200
  Re: Sequencing images using tkinter? theteacher.info@gmail.com - 2014-08-30 13:37 -0700
    Re: Sequencing images using tkinter? Peter Otten <__peter__@web.de> - 2014-08-30 23:14 +0200
      Re: Sequencing images using tkinter? theteacher.info@gmail.com - 2014-08-31 02:51 -0700

csiph-web