[ACCEPTED]-Python command line input in a process-multiprocessing

Accepted answer
Score: 16

When you spawn a thread in Python, it closes stdin. You 6 can't use a subprocess to collect standard 5 input. Use the main thread to collect input 4 instead and post them to the Queue from 3 the main thread. It may be possible to 2 pass the stdin to another thread, but you 1 likely need to close it in your main thread.

Score: 5

I was able to work around this by using 3 fdopen() to reopen stdin in the subprocess. See this answer. It 2 seems to be working, I don't know if there 1 are any hidden risks.

More Related questions