How to Use Python to Run an App in a New Process: Best Practices?

18 Replies, 1648 Views

Hey everyone,

So, I’ve been trying to figure out how to Python run app in new process, and I’m kinda stuck. I know there are a few ways to do it, like using `subprocess` or `multiprocessing`, but I’m not sure which one’s the best for my use case.

I’ve got this app that needs to run independently, and I don’t want it to block the main script. Any tips on the best practices here? Like, should I be worried about memory leaks or zombie processes?

Also, is there a way to make sure the new process closes cleanly if something goes wrong? I’ve heard `atexit` might help, but idk if that’s overkill.

Thanks in advance for any advice! Cheers.

Messages In This Thread
How to Use Python to Run an App in a New Process: Best Practices? - by - 13-08-2024, 02:15 PM



Users browsing this thread: 1 Guest(s)