[Tkinter-discuss] Stopping a for loop with a sleep() funciton in it

Alexnb alexnbryan at gmail.com
Sun Jul 13 21:30:46 CEST 2008




Cameron Laird-2 wrote:
> 
> On Thu, Jul 10, 2008 at 10:30:53PM -0700, Alexnb wrote:
> 			.
> 			.
> 			.
>> yes I know it runs in milliseconds. So what do you suggest? 1 millisecond
>> is
>> about what I want. it was .1 seconds for the sleep() time. 
>> I didn't write this code I found it online so I don't really understand
>> it,
>> but I know that is where the problem is, the for loop.
>> 
>> Guilherme Polo wrote:
>> > 
>> > On Thu, Jul 10, 2008 at 8:45 PM, Guilherme Polo <ggpolo at gmail.com>
>> wrote:
>> >> On Thu, Jul 10, 2008 at 8:24 PM, Alexnb <alexnbryan at gmail.com> wrote:
>> >>>
>> >>>
>> >>>
>> >>> Guilherme Polo wrote:
>> >>>>
>> >>>> On Thu, Jul 10, 2008 at 7:31 PM, Alexnb <alexnbryan at gmail.com>
>> wrote:
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> Guilherme Polo wrote:
>> >>>>>>
>> >>>>>> On Thu, Jul 10, 2008 at 5:57 PM, Alexnb <alexnbryan at gmail.com>
>> wrote:
> 			.
> 			.
> 			.
>> >>>>>    def sleeper():
>> >>>>>        root.update
>> >>>>
>> >>>> What if you change this to root.update() ?
>> >>>>
>> >>>>>        root.after(1, sleeper)
> 			.
> 			.
> 			.
> Again, I'm fuzzy on what questions remain open.  The code
> above is almost certainly wrong, though; far more likely
> to be useful would be something like
> 
>   def sleeper():
>       root.after(100, sleeper)
> 	  # update() is almost certain to introduce problems.
>       check_global_variables_and_so_on()
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss
> 
> 

No questions remain. I have given up on the idea. I didn't write the bar, I
found it online. So it was hard for me to know exactly what was going wrong.
It is a lot of code that no one really wants to go though. So no worries,
but thanks for helping!

-- 
View this message in context: http://www.nabble.com/Stopping-a-for-loop-with-a-sleep%28%29-funciton-in-it-tp18391735p18432900.html
Sent from the Python - tkinter-discuss mailing list archive at Nabble.com.



More information about the Tkinter-discuss mailing list