Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!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.052 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'referring': 0.07; 'subject:using': 0.09; 'def': 0.12; 'bind': 0.16; 'client:': 0.16; 'left,': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'skip:p 40': 0.19; 'aug': 0.22; 'header:User-Agent:1': 0.23; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'work.': 0.31; 'getting': 0.31; 'skip:m 30': 0.32; 'run': 0.32; 'could': 0.34; "can't": 0.35; 'something': 0.35; 'received:google.com': 0.35; '+0200,': 0.36; 'subject:?': 0.36; 'starting': 0.37; 'button': 0.38; 'displays': 0.38; 'e.g.': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'url:mail': 0.40; 'hope': 0.61; 'helps': 0.61; 'first': 0.61; 'times': 0.62; 'kind': 0.63; 'albert': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:to:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=itKCHFr+bLoozCXitUXHaz890pi2+naP/YDZak7F1YY=; b=IWKG4+zdUtS4ktHSFFM5SiMkGFlXt1vuMjvVjxm/m+2ps4T+NJNJ0i1QL485mw2SF5 gjAL9jZr/9xU69uwHticvfh0fA38spmkJ6ZdPxXZI74gZvjn54SrFEkWPstmxUKVhVT4 Z94rH8iX20RSwRsdUW/7twxqz1akg37bLRhVXpLqBrU1Y/z2SkStw0OD0RKwtVlBajBW 3Y6j0mPJ8NhIexwjXmSgmPVb4FdcBPWlTD3nMw6qPt4TirySewalXLu9g13+iU/zkf27 HhjuU4FkG0i8zmlPey09Kpf24uNnj9BJAbaMERsCGBr9PESBz3a/FbGOmoolZ0zNPKLN xuMA== X-Received: by 10.180.92.73 with SMTP id ck9mr12296735wib.54.1409431771561; Sat, 30 Aug 2014 13:49:31 -0700 (PDT) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: python-list@python.org Subject: Re: Sequencing images using tkinter? References: Date: Sat, 30 Aug 2014 22:49:29 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Albert Visser" In-Reply-To: User-Agent: Opera Mail/12.16 (Linux) 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: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1409433077 news.xs4all.nl 2876 [2001:888:2000:d::a6]:46060 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:77335 On Sat, 30 Aug 2014 22:27:01 +0200, wrote: > Although getting next_image to run for e.g. 10 times in a for loop is > still something I can't get to work. It only displays one image. I think this is because you do all your processing befoe starting the event loop (myGui.mainloop() ). A better way is to bind the function that displays the images to a button callback. Referring to your first post, that could be something like (untested) def rotate(): for i in range(10): myImage = PhotoImage(file="MonsterImages/Converted/" + random.choice(monsters)) myButton1.config(image=myImage, width="100", height="200") sleep(0.2) myButton1=Button(canvas1, text='OK', justify = LEFT, command=rotate) myButton1.place(x=500,y=300) myGui.mainloop() Hope this helps -- Vriendelijke groeten / Kind regards, Albert Visser Using Opera's mail client: http://www.opera.com/mail/