I'm using pexpect to provide login information for a long running command. That part is working. However, I then want to display the output from that command as it progresses. I am trying the following code where proc is a pexpect.spawn object:
while True:
try:
output=proc.readline(timeout=300)
print(output)
except:
continueWhile I know the command is outputting lines, the readline never returns anything, it just keeps timing out. How do I retrieve the command output as it progresses? I'm looking for the equivalent to stdout.PIPE used by popen. TIA.
