帮忙改下代码谢谢
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
from multiprocessing import Process, Pool
from logindev import everysw
from logindev import mtsub
import time
import threadpool
import Queue
import datetime
a=[[("a","b","c"),("1","2","3"),("x","y","z")],[("11","22","33"),("44","55","66"),("77","88","99")]]
print len(a)
def prt(xxx):
print xxx,datetime.now()
def pt(ptpt):
pool=Pool(1)
re1=pool.map(mt,ptpt)
pool.close()
pool.join()
def mt(data):
pool=threadpool.ThreadPool(1)
re= threadpool.makeRequests(prt,data)
for x in re:
pool.putRequest(x)
time.sleep(1)
pool.wait()
pt(a)
root@webserver:/home/app/apsw# python test.py
2
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/threadpool.py", line 158, in run
result = request.callable(*request.args, **request.kwds)
TypeError: prt() argument after ** must be a mapping, not str
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/threadpool.py", line 158, in run
result = request.callable(*request.args, **request.kwds)
TypeError: prt() argument after ** must be a mapping, not str
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/threadpool.py", line 158, in run
result = request.callable(*request.args, **request.kwds)
TypeError: prt() argument after ** must be a mapping, not str
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/threadpool.py", line 158, in run
result = request.callable(*request.args, **request.kwds)
TypeError: prt() argument after ** must be a mapping, not str
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/threadpool.py", line 158, in run
result = request.callable(*request.args, **request.kwds)
TypeError: prt() argument after ** must be a mapping, not str
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/threadpool.py", line 158, in run
result = request.callable(*request.args, **request.kwds)
TypeError: prt() argument after ** must be a mapping, not str