[ACCEPTED]-Python command line input in a process-multiprocessing
Accepted answer
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.
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.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.