Advertisement
nigaky

queue1

Mar 28th, 2014
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. from multiprocessing import Process, Queue
  2.  
  3. def f(queue):
  4.     queue.put([42, None, 'hello'])
  5.  
  6. if __name__ == '__main__':
  7.     queue = Queue()
  8.     p = Process(target=f, args=(queue,))
  9.     p.start()
  10.     print(queue.get())   # prints "[42, None, 'hello']"
  11.     p.join()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement