# You must initialize the gobject/dbus support for threading # before doing anything. import gobject gobject.threads_init() from dbus import glib glib.init_threads() # Create a session bus. import dbus bus = dbus.SystemBus() # Create an object that will proxy for a particular remote object. remote_object = bus.get_object("fi.w1.wpa_supplicant1", # Connection name "/fi/w1/wpa_supplicant1/Interfaces/5" # Object's path ) for i in range(0, 500000): # Get a particular interface iface = dbus.Interface(remote_object, 'fi.w1.wpa_supplicant1.Interface') print i, iface.SignalPoll()