0

I'm issuing a script remotely via SSH python paramiko

stdin, stdout, stderr = host['connection'].exec_command(command)

However, I notice stdout does not get flushed until the remote command is completed. The remote script takes up to 60 seconds to complete but I can really use the data during that time to make decisions. Is it possible to force flush the stdout buffer during the remote command execution?

user2066671
  • 177
  • 4
  • 16
  • How do you read from stdout? Could you provide a [complete minimal code example](http://stackoverflow.com/help/mcve) with a dummy command that shows the issue? – jfs Apr 25 '14 at 21:11

1 Answers1

0

Try running the script using "python -u script_name.py" From python's command line args: -u "unbuffered binary stdout and stderr;"

Travis D.
  • 342
  • 1
  • 9
  • still buffering until the completion of the remote execution – user2066671 Apr 25 '14 at 20:36
  • This actually looks like the same issue that was reported here? http://stackoverflow.com/questions/14643861/paramiko-channel-stucks-when-reading-large-ouput – Travis D. Apr 25 '14 at 20:58