PyDocs

Nav

Concurrent Execution

get_context

multiprocessing

function · Added in 3.4 (source) not Androidnot iOSnot WASI
  • get_context(method=None)
Return a context object which has the same attributes as the multiprocessing module.
1 Example
>>> mp_context = multiprocessing.get_context('spawn')
>>> manager = mp_context.Manager()
>>> l = manager.list([i*i for i in range(10)])
>>> print(l)
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
>>> print(repr(l))
<ListProxy object, typeid 'list' at 0x...>
>>> l[4]
16
>>> l[2:5]
[4, 9, 16]
from the Python docs
See Also
No see-alsos for multiprocessing/get_context
0 Notes
No notes for get_context