[Tkinter-discuss] non-GUI event detection in Tkinter mainloop()
igor.e.novikov at gmail.com
Wed May 20 11:25:08 CEST 2009
File system events are not a part of tk library so Tkinter doesn't process
Nevertheless native _tkinter library contains two file event related
procedures - createfilehandler() and deletefilehandler()
So you can try finding samples how to use these functions. For example:
Also you can try resolving this issue using "fileevent" tcl command:
But this way supposes tcl programming.
On Wed, May 20, 2009 at 1:08 AM, O'Gorman, Lawrence (Larry) <
larry.ogorman at alcatel-lucent.com> wrote:
> I’m trying to figure out if Python and Tkinter can offer a solution to my
> following problem. I want to monitor a file and when that file is changed, I
> want to detect that event and have my window change its text from “File
> Unchanged” to “File has Changed.”
> That is, I can produce a function to periodically sample the modification
> time of a file and if it is different than my last sample time, then this
> function will return an indication that the file is changed. I want this
> file-change event to be captured by the tkinit mainloop(), which I will then
> use to change the appearance of my window.
> I understand that any GUI event (mouse, keyboard, etc.) can be detected in
> the mainloop(), but I have seen no indication in the documentation and
> discussions that a file-change can produce an event that can be detected in
> the mainloop(). Does anyone know if I can do this? If so, how? Or, if there
> is an alternative way than mainloop() to get a window to change upon a
> file-change, that would be helpful, too.
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tkinter-discuss