How to Properly Use Python to Run an App in Process: Best Practices and Common Pitfalls?

18 Replies, 1548 Views

Yo, I feel you on the app hanging thing. Happens to me all the time when I Python run app in process.

I’d say go with `subprocess` if you’re running external stuff, but watch out for deadlocks if you’re using `stdout`/`stderr`.

Also, make sure to use `Popen` with `communicate()` or `wait()` to avoid zombies. And yeah, `multiprocessing` is solid for internal tasks, but it can get messy with shared resources.

Good luck!

Messages In This Thread



Users browsing this thread: 1 Guest(s)