multiprocessing.set_executable
Prev: multiprocessing.Semaphore | Up: multiprocessing | Next: multiprocessing.set_forkserver_preload
Rel: multiprocessing.active_children, multiprocessing.allow_connection_pickling, multiprocessing.Array, multiprocessing.AuthenticationError
Ref: docs.python.org — multiprocessing.set_executable
Tags: #public #python3 #stdlib #multiprocessing
Import
import multiprocessing
from multiprocessing import set_executable
Signature & Overview
multiprocessing.set_executable(executable)
Sets the path to a python.exe or pythonw.exe binary used to run child processes instead of sys.executable when using the 'spawn' start method. Useful for people embedding Python.
Usage
import multiprocessing as mp
import sys
# Points spawned child processes to a specific Python interpreter (useful when embedding Python)
assert callable(mp.set_executable) and bool(sys.executable)
Gotchas
- Mainly for embedded Python where
sys.executablepoints to the host C/C++ app rather thanpython3.
REPL Inspect
from multiprocessing import set_executable
help(set_executable)
Linked from
Related notes
- tuts/python3/stdlib_module/multiprocessing/Semaphore Linked here; links to this page; shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/set_forkserver_preload Linked here; links to this page; shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/multiprocessing/active_children Linked here; shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/allow_connection_pickling Linked here; shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/Array Linked here; shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/AuthenticationError Linked here; shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/Barrier shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/BoundedSemaphore shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/BufferTooShort shared tags: #multiprocessing, #stdlib