I've read the documentation and I've tried lots of things in the REPL, and Googled, but I can't for the life of me understand how subprocess.Popen works in Python.
Here is some Ruby code I am using:
IO.popen("some-process") do |io|
while(line = io.gets)
# do whatever with line
end
end
How do I translate this into Python using subprocess.Popen?