Mar-23-2020, 03:31 PM
(This post was last modified: Mar-23-2020, 05:36 PM by Gribouillis.)
If you want to do something with the client, you need to keep a reference to the client, which is not the case here because your client is a local variable of the wrap() function.
The simplest way to interact is to send command lines to the client like so
The simplest way to interact is to send command lines to the client like so
stdin, stdout, stderr = client.exec_command(command) # <--- get the command from a form perhaps? status = stdout.channel.recv_exit_status() for line in stdout: print(line) # <--- or write the line to the text window insteadAnother solution for a better simulation of interactive ssh sessions is probably to use the paramiko_expect module and try to print the messages sent and received as shown to the Tkinter text window.