import commands
import threading
class Idletime(threading.Thread):
def run(self):
idle=commands.getoutput('xprintidle')
time.sleep(5)
def getidletime():
return idle
test = Idletime
test.start()
А меня ругает вот так:
Traceback (most recent call last):
File "<pyshell#10>", line 1, in <module>
test.start()
TypeError: unbound method start() must be called with Idletime instance as first argument (got nothing instead)
OC: Ubuntu 10.10