Just to make sure that the Gtk way is also present in an answer:

The equivalent of

gtk.timeout_add(PING_FREQUENCY * 1000, self.doWork)

in gobject introspection (PyGI) is:

from gi.repository import GLib
GLib.timeout_add(PING_FREQUENCY * 1000, self.doWork)

However, when checking something regularly every x seconds, you should use

GLib.timeout_add_seconds(PING_FREQUENCY, self.doWork)

This allows the Glib to group timers and therefore save power, which is important for mobile devices. From the documentation:

The grouping of timers to fire at the same time results in a more power and CPU efficient behavior so if your timer is in multiples of seconds and you don't require the first timer exactly one second from now, the use of glib.timeout_add_seconds() is preferred over glib.timeout_add().


It is better to ask one question per... err... question.

Python's standard library has threading module which has a Timer class which does exactly what you need. Documentation.

Regarding push vs pull - it is definitely better when your application receives a notification when something happens (push) instead of checking if something happened every second (pull) - "are we there yet? are we there yet? are we there yet?.." - because it allows your app to just sleep and do nothing until it's notified, as opposed to doing the same repeating check every second. The thing is, however, that for some types of activities it may be tricky to get a notification, so it depends on the nature of your application. Doing checks too often is also bad for battery life and other stuff.