Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #91923
| References | <3603e97e-686a-47de-aff4-cabfcb930064@googlegroups.com> |
|---|---|
| Date | 2015-06-03 12:37 +0530 |
| Subject | Re: Issuing commands using "exec_command()" of paramiko AND also sending commands together |
| From | Sreenathan Nair <sreenath.cg@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.92.1433315397.13271.python-list@python.org> (permalink) |
[Multipart message — attachments visible in raw view] - view raw
Hi,
Could you be more specific about your problem? Perhaps an example of
something similar to what you're trying to do would be helpful.
Usually the process is to instantiate paramiko.SSHCLIENT, use the connect()
method with desired parameters and execute commands using the
exec_command(). If you'd like to process the output of the command
execution, then you would store the result of exec_command() into three
variables (it return a 3-tuple of Channel objects).
i.e com_stdin, com_stdout, com_stderr =
my_ssh_client_instance.exec_command("<command>")
The instance of SSHCLIENT is live until the close() method is called.
Meaning subsequent commands can be executed the same way.
On Wed, Jun 3, 2015 at 8:07 AM, Pythonista <kukki.kanchana@gmail.com> wrote:
> Using paramiko's exec_command(), i would like to send a command, process
> its output and do it for several other commands. I notice that its not
> quick enough or something like that.
>
> How would I handle that scenario AND also providing multiple commands
> together (there is 1 post on stackoverflow for issuing multiple commands
> but I am not sure if someone has tried it. It didnt work for me!
>
> Thanks!
> --
> https://mail.python.org/mailman/listinfo/python-list
>
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Issuing commands using "exec_command()" of paramiko AND also sending commands together Pythonista <kukki.kanchana@gmail.com> - 2015-06-02 19:37 -0700
Re: Issuing commands using "exec_command()" of paramiko AND also sending commands together Sreenathan Nair <sreenath.cg@gmail.com> - 2015-06-03 12:37 +0530
Re: Issuing commands using "exec_command()" of paramiko AND also sending commands together KR <kavithabhaskaran2013@gmail.com> - 2015-06-03 06:07 -0700
csiph-web