Python subprocess call background process in thread

broken image

When we're done, we want to shut down the child process in an orderly way. We launch it as a child process, then connect clients to it and run some testing sequence. Think about testing some server - for example, an HTTP server. In this post, I want to discuss a variation of this task that is less directly addressed: long-running child processes.

broken image
broken image
broken image

It comes with several high-level APIs like call, check_output , and (starting with Python 3.5) run that are focused on child processes that our program runs and waits to complete. The Python subprocess module is a powerful Swiss Army knife for launching and interacting with child processes.

broken image