Interacting with a long-running child process in Python
eli.thegreenplace.net
eli.thegreenplace.net
I'd like to be able to launch a long-running subprocess and iterate over every line of output in a coroutine. It seems this is not possible to do correctly without 50 lines of code. I know it's not as simple as it sounds (or people wouldn't still be using Tcl based Expect scripts eveywhere)... but it's still some complexity that could be hidden away in a library somewhere.