On 11 August 2013 09:57, Chris Angelico <ros...@gmail.com> wrote:
> On Thu, Aug 8, 2013 at 8:20 AM, sagar varule <sagar.var...@gmail.com> wrote:
>>  stdin, stdout, stderr = client.exec_command(bv_cmd)
>>             for line in stderr.readlines():
>>                 print line
>>             for line in stdout.readlines():
>>                 print line
>> But problem here is client.exec_command(bv_cmd) waits for command to execute 
>> completely and then it returns to stdout,stderr. And I want to see the ouput 
>> from the command during its execution. Because my command takes long time 
>> for execution.
>
> Are you certain that exec_command is what's waiting, and not readlines()?

That's a very good catch;

Sagar, you might want to look at:
http://stackoverflow.com/a/4896288/1763356
for a good solution if this is the case. There might be more builtin
ways (maybe select.select) but I'm betting that link's the most
rigorous.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to