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

Cameron Laird Cameron at phaseit.net
Sun Jul 13 21:27:55 CEST 2008


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()


More information about the Tkinter-discuss mailing list