目前我在 python 中遇到错误,但我似乎找不到它们
def dictionaryObjectParsed():
a = []
b = []
a, b = zip(*(map(lambda x: x.rstrip('\n\r').split('\t'), open('/Users/settingj/Desktop/NOxMultiplier.csv').readlines())))
for x in range(0,len(a)):
print a[x]
print b[x]
def timer(f):
threading.Timer(1, timer, f).start()
print time.strftime('%I:%M:%S %p %Z')
timer(dictionaryObjectParsed)
这是我得到的错误
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 756, in run
self.function(*self.args, **self.kwargs)
TypeError: timer() argument after * must be a sequence, not function
我之前能够做到这一点,但我想我做了一些事情来制造这个错误,到底是什么:(
我显然正在将参数传递给计时器函数......对吗?
编辑
我也试过timer(dictionaryObjectParsed)
了,但没有...
另外,对于noobie问题,这只是我在python中的第二天......:P