I have a problem with dbus and python. Running python from the command line, telling it import dbus
and then systembus = dbus.SystemBus()
results in no errors, nor does running a program written by a friend which also uses the exact same code. However, when running a program I'm trying to write, I get this error:
Traceback (most recent call last):
File "dbtest.py", line 26, in <module>
a = getDevs()
File "dbtest.py", line 7, in getDevs
bus = dbus.SystemBus()
AttributeError: 'module' object has no attribute 'SystemBus'
Any ideas as to what I'm doing wrong? I don't think I fully understand the error returned. The code I have so far is:
#!/usr/bin/env python
import dbus
def getDevs():
bus = dbus.SystemBus()
if __name__ == "__main__":
a = getDevs()