Via Simon, Python: How to fork and return text from the child process
Nothing original here, but there are a couple of quirks, so I'm going to write it up in case anyone else is looking for how to do this. The process is the same as in C.
Why?
Sometimes, inside an application, for some reason you don't want to run something in-process. Maybe you don't trust the code you're running and want to use ulimit to restrict it from allocating too much memory or opening too many files, or maybe it Just Doesn't Work in-process.
Feel free to post a comment below. Please see my comment policy.
Formatting Rules (No HTML):