2 years ago

#43069

test-img

Null

How to open a process and don't wait for it to finish?

I need to open a few processes (which are unrelated to Python) to run concurrently to the Python-interpreter ( which launches them, but does not wait for them to finish to continue its own code execution).

Ideally, I will give a callback function for when the process ends.

Example:

def callback(exitcode: int) -> None:
    pass

start_process("g++ file1.cpp", callback=callback)
start_process("gcc file2.c")

If my program terminates before the called programs, I don't care to not get a callback. I have looked at the subprocess module but the functions there wait for the process to end.

python

process

multiprocessing

concurrent-processing

0 Answers

Your Answer

Accepted video resources