Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #52377
| References | <c665ba05-2843-4e44-a6d0-b29d508fd9f4@googlegroups.com> <CAPTjJmp-WcDkMRjWGQVfaVoSP95HX2mhfRhpc=LRij1RanDYvg@mail.gmail.com> |
|---|---|
| From | Joshua Landau <joshua@landau.ws> |
| Date | 2013-08-11 11:10 +0100 |
| Subject | Re: Paramiko Help. Execute command to Interactive Shell which is opened by SSHClient() |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.476.1376215889.1251.python-list@python.org> (permalink) |
On 11 August 2013 09:57, Chris Angelico <rosuav@gmail.com> wrote: > On Thu, Aug 8, 2013 at 8:20 AM, sagar varule <sagar.varule@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.
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Paramiko Help. Execute command to Interactive Shell which is opened by SSHClient() sagar varule <sagar.varule@gmail.com> - 2013-08-08 00:20 -0700
Re: Paramiko Help. Execute command to Interactive Shell which is opened by SSHClient() sagar varule <sagar.varule@gmail.com> - 2013-08-10 22:18 -0700
Re: Paramiko Help. Execute command to Interactive Shell which is opened by SSHClient() Joshua Landau <joshua@landau.ws> - 2013-08-11 06:58 +0100
Re: Paramiko Help. Execute command to Interactive Shell which is opened by SSHClient() sagar varule <sagar.varule@gmail.com> - 2013-08-11 00:02 -0700
Re: Paramiko Help. Execute command to Interactive Shell which is opened by SSHClient() Joshua Landau <joshua@landau.ws> - 2013-08-11 08:10 +0100
Re: Paramiko Help. Execute command to Interactive Shell which is opened by SSHClient() Chris Angelico <rosuav@gmail.com> - 2013-08-11 09:57 +0100
Re: Paramiko Help. Execute command to Interactive Shell which is opened by SSHClient() Joshua Landau <joshua@landau.ws> - 2013-08-11 11:10 +0100
csiph-web