What is the difference between multiprocessing and subprocess?

前端 未结 3 487
闹比i
闹比i 2020-12-07 11:03

My work should use parallel techniques, and I a new user of python. So I wonder if you could share some material about the python multiprocessing and subp

3条回答
  •  离开以前
    2020-12-07 11:27

    If you want to call an external program (especially one not written in Python) use subprocess.

    If you want to call a Python function in a subprocess, use multiprocessing.

    (If the program is written in Python, but is also importable, then I would try to call its functions using multiprocessing, rather than calling it externally through subprocess.)

提交回复
热议问题