Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

multiprocessing queue python

from multiprocessing import Process, Queue

def f(q):
    q.put([42, None, 'hello'])

if __name__ == '__main__':
    q = Queue()
    p = Process(target=f, args=(q,))
    p.start()
    print(q.get())    # prints "[42, None, 'hello']"
    p.join()
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #multiprocessing #queue #python
ADD COMMENT
Topic
Name
5+7 =