在這裏,我有我的問題相關的代碼片段:2位數()的參數不工作
from threading import Thread
.
.
.
def do_post(thread_no):
print "Starting thread no: " + thread_no + "\n"
.
.
.
for i in range(0,MAX_THREADS):
try:
t=Thread(target=do_post, args=('%d'%i))
t.start()
.
.
當max_threads的> 10我得到的錯誤信息:TypeError: do_post() takes exactly 1 argument (2 given)
怎麼辦我讓它接受2位數字?
感謝。不知道.name的存在。使代碼更簡潔。 – asudhak 2013-03-20 19:56:03