Shiv Deepak
Shiv Deepak

Reputation: 3116

How to change text on gtk.label in frequent intervals - PyGTK

I am coding a desktop application which shows contents from text file in a gtk.label, i update that text file, say once in every 15 mints. Are are there any methods to make the application to read the text file in constant intervals and display it without restarting the window

Upvotes: 1

Views: 914

Answers (1)

Frédéric Hamidi
Frédéric Hamidi

Reputation: 262939

On all platforms, you can call gobject.timeout_add() to read the file every once in a while, or gobject.idle_add() with an mtime check to do it when the app is idle.

On linux, I'd recommend using pyinotify to monitor the file and re-read it only when it's updated.

Upvotes: 1

Related Questions