Python command line input in a process

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

Leave a Comment