这段python代码有问题,请大神帮我看下

import Queue
from threading import Thread

def get(nums):
while True:
if myqueue.empty()==False:
print 'Thread %d : %s' %(nums, myqueue.get())
else:
break

def main():
thread=[]
nums=5
for a in xrange(5):
thread.append(Thread(target=get, args=(a+1)))
for a in thread:
a.setDaemon(True)
a.start()

if __name__ == "__main__":
global myqueue
myqueue=Queue.Queue()
list=[]
for a in xrange(100):
list.append(str(a+1))
for a in list:
myqueue.put(a)
main()

-------------------------------------------------------------------------
Traceback (most recent call last):
File "D:\software\python2.7.4\lib\threading.py", line 810, in __bootstrap_inner
self.run()
File "D:\software\python2.7.4\lib\threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
TypeError: get() argument after * must be a sequence, not int

该怎么改??求指教

第1个回答  推荐于2017-11-26
thread.append(Thread(target=get, args=(a+1,)))

加个逗号表示这是一个元素的列表?本回答被提问者采纳
相似回答