Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pathos.multiprocessing import ProcessingPool
- import dill
- import datetime
- class my_class(Object):
- def __init__(self):
- pool = ProcessingPool(nodes=4)
- p1 = [1,2,3]
- p2 = [4,5,6]
- p3 = [7,8,9]
- results = pool.map(self.my_func, p1, p2, p3)
- def my_func(x,y,z):
- print(x,y,z)
- def status_printout(self,message):
- header = datetime.datetime.now().strftime('%Y/%m/%d %H:%M:%S')
- print(header+' -- '+message)
Add Comment
Please, Sign In to add comment