Python muliprocessing - Get values from manager.list()

时间:2016-11-26 18:33:09

标签: python shared-memory python-multiprocessing

I have the following code:

from multiprocessing import Manager

manager = Manager()
shared_list= manager.list()
#fill shared_list using some processes

and then I'd like to put the results from the shared_arr to a list.

print shared_list[0:ind]

outputs the content of the shared list, however, I can't do

buffer = Array(c_char_p, len(data))
buffer[0:ind] = shared_list[0:ind]

since buffer is then filled with junk like LINGER and softspace. How can I get the data out of the shared_list into another variable? Thank you!

0 个答案:

没有答案