【发布时间】:2018-04-22 04:53:46
【问题描述】:
# coding: utf-8
import multiprocessing
class A(object):
def __init__(self):
pass
def run(self):
sheets = ['a', 'b', 'c', 'd', 'e']
result = []
pool = multiprocessing.Pool(processes=5)
for index, sheet in enumerate(sheets):
result.append(pool.apply_async(self.test, (sheet)))
pool.close()
pool.join()
for data in result:
print data.get()
def test(self, args):
return args
if __name__ == '__main__':
A().run()
我尝试运行上面的代码并得到一个错误,希望得到你的答案:cPickle.PicklingError: Can't pickle : attribute 查找 builtin.instancemethod 失败
【问题讨论】: