Ich bin wieder über meinem Timer Problem - bitte nicht lachen - --- ich bekomme ihn nicht aufgerufen und ich check die Fehlermeldung nicht.
Die Imports sind mehr oder minder geraten
Code: Alles auswählen
import threading
import timeit
from timeit import Timer
def hello():
print "hello, world"
t = Timer(30.0, hello)
t.start() # after 30 seconds, "hello, world" will be printed
flo@AKB-12:~/Desktop/ccd_astex$ python test.py
Traceback (most recent call last):
File "test.py", line 15, in <module>
t = Timer(30.0, hello)
File "/usr/lib/python2.5/timeit.py", line 112, in __init__
stmt = reindent(stmt,
File "/usr/lib/python2.5/timeit.py", line 91, in reindent
return src.replace("\n", "\n" + " "*indent)
AttributeError: 'float' object has no attribute 'replace'
Den Code Schnipsel habe ich von:
http://docs.python.org/lib/timer-objects.html
Danke!