First of all I am a newcomer to programming languages world and of course very new to Python.

In my job, we are using Linux systems. Time to time I need to check some command and script outputs on the terminal. So, I wanted to code a small application with a very basic GUI and chose Python and Pygtk with Glade. Unfortunately, our Linux distros are not so up to date and I can only use Python 2.4.3 and Glade 2.12.1. I know those are too old, but I have to use them.

Ater studying Python and Pygyk just a bit and with the help of tons of tutorials, I managed to code a basic application with a primitive GUI. For example when I click a button, it collects some system info and write those to a label. And so on. I create different buttons for different purposes. This is ok but not so useful. As you guess, I want those labels are auto refreshed for some period (i.e for every ten min). I search the web and found Timer class. Also, I encounter thread issues. But I can't apply those to my simple code since I am a noob. Here is my code:

#!/usr/bin/env python

import os
import ...

class MyProject:
    def __init__(self):
        self.gladefile = "myproject.glade"
        self.wTree = gtk.glade.XML(self.gladefile)

        dic = { "on_window1_destroy" : gtk.main_quit,
                "on_sis_button.clicked" : self.sis_button_clicked,
                "on_......                            }


    def sis_button_clicked(self, widget):
        sislbl = self.wTree.get_widget("sis_label1")

    def ......

if __name__ == "__main__":
    frm = MyProject()

Now, how can I apply auto refresh or something like that to my code. Do I have to apply it label per label, or is it possible to do it globally? Am I on the right way, or should I totally change my code concept?

Thank you.

Note: I can read manuals if you point me. Direct code suggestions will make me so pleased.

This article has been dead for over six months. Start a new discussion instead.