[Tkinter-discuss] tkinter "monitor" and root.mainloop()

Peter Milliken peter.milliken at gmail.com
Fri May 23 01:10:48 CEST 2008


in the time module, look at a function called sleep - arguments are 1 second
intervals from memory i.e. something like this:

import time

while True:
  <check file for changes and take appropriate action>

  time.sleep(5)          -- delay for 5 seconds before resuming loop




On Thu, May 22, 2008 at 8:59 AM, Cameron Laird <Cameron at phaseit.net> wrote:

> On Wed, May 21, 2008 at 12:49:22PM +0200, Marco wrote:
>                        .
>                        .
>                         .
> > I am quite new to tkinter programming, and i have a question.
> >
> > I am writing a "monitor": basically it reads a file on the filesystem
> > and reports it in a graphical way using python and tkinter.
> >
> > Now the file, over time, changes, so once called root.mainloop() i'd
> > need to reread the file, update the objects in memory and redraw the
> > tkinter main window.
> >
> > How can I achieve that? Ideas? Suggestions? Is my approach wrong?
>                         .
>                        .
>                        .
> Poll with after().  Fredrik's references, among others,
> explain this.  I'll be tied up for a day; if you don't
> work out the details on your own, I'll return to explain.
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tkinter-discuss/attachments/20080523/376758fa/attachment.htm>


More information about the Tkinter-discuss mailing list