jesuisbenjamin
April 18th, 2011, 03:37 PM
Hello,
i'm trying the glib.timeout_add() function (see doc over here (http://developer.gnome.org/pygobject/stable/glib-functions.html#function-glib--timeout-add)). But i can't seem to get the loop started:
import glib
class Thing():
def sayhi(self):
print "hello"
def repeat(self):
glib.timeout_add(3000, self.sayhi)
if __name__ == '__main__':
thing = Thing()
thing.repeat()
Any idea how i should do this?
Thanks
Benjamin
i'm trying the glib.timeout_add() function (see doc over here (http://developer.gnome.org/pygobject/stable/glib-functions.html#function-glib--timeout-add)). But i can't seem to get the loop started:
import glib
class Thing():
def sayhi(self):
print "hello"
def repeat(self):
glib.timeout_add(3000, self.sayhi)
if __name__ == '__main__':
thing = Thing()
thing.repeat()
Any idea how i should do this?
Thanks
Benjamin