Python Forum
Start Putty into Python Form
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Start Putty into Python Form
#4
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
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 instead
Another 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.
Reply


Messages In This Thread
Start Putty into Python Form - by Schlazen - Mar-20-2020, 10:23 AM
RE: Start Putty into Python Form - by Gribouillis - Mar-20-2020, 11:13 PM
RE: Start Putty into Python Form - by Schlazen - Mar-23-2020, 01:51 PM
RE: Start Putty into Python Form - by Gribouillis - Mar-23-2020, 03:31 PM
RE: Start Putty into Python Form - by Schlazen - Mar-25-2020, 03:03 PM
RE: Start Putty into Python Form - by divya130 - Dec-13-2022, 06:28 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python and pandas: Aggregate lines form Excel sheet Glyxbringer 12 2,016 Oct-31-2023, 10:21 AM
Last Post: Pedroski55
  Python Idle won't start totalmachine 9 3,622 Oct-16-2022, 05:57 PM
Last Post: totalmachine
  readline.parse_and_bind() does not work in start-up script of Python interpreter zzzhhh 0 1,569 Jan-18-2022, 11:05 AM
Last Post: zzzhhh
  Error creating database with python and form? shams 3 2,406 Aug-02-2021, 02:00 PM
Last Post: deanhystad
  Error using mariadb select query with form in python? shams 2 2,058 Jul-29-2021, 12:30 PM
Last Post: shams
  html, python, a simple form test 1 1,973 Aug-09-2020, 01:59 PM
Last Post: snippsat
  Reading text from Putty window Nil 5 9,262 Jul-23-2020, 10:27 AM
Last Post: HritikaMehta
  Use Python to start/stop a server service via a webform? oakleaf2001 0 1,781 Apr-04-2020, 06:14 AM
Last Post: oakleaf2001
  Python 3.8 on mac failing to start sgandon 0 2,936 Jan-14-2020, 10:58 AM
Last Post: sgandon
  How to get first 5 images form the document using Python BeautifulSoup sarath_unrelax 0 1,670 Dec-19-2019, 07:13 AM
Last Post: sarath_unrelax

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020