Hacker Newsnew | comments | ask | jobs | submitlogin
Subprocess Hanging: PIPE is your enemy (thraxil.org)
2 points by dpapathanasiou 855 days ago | comments


1 point by bayareaguy 855 days ago | link

I've found the pexpect[1] module often works better than subprocess module.

pexpect.spawn() also provides a trivial way for the caller of a long running process to periodically regain control and see what's going on via the timeout parameter and the TIMEOUT exception.

[1] - http://pexpect.sourceforge.net/pexpect.html

-----




Lists | RSS | Search | Bookmarklet | Guidelines | FAQ | News News | Feature Requests | Y Combinator | Apply | Library

Analytics by Mixpanel