python: fork without an external command, and capturing stdout and stderr separately
问题 I'd like to fork a subprocess in python that does not run an external command ... it would just run a defined function. And I want to capture stdout and stderr separately. I know how to use os.fork() and os.pipe() , but that mechanism only gives me two fd's to work with. I'm looking for three fd's: one for stdin , one for stdout , and one for stderr . This is easy to manage using subprocess.Popen when running an external command, but that function doesn't seem to allow a local function to be