Advertisement
Guest User

Untitled

a guest
Aug 12th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. import paramiko
  2.  
  3. def fun1():
  4. try:
  5. ssh = paramiko.SSHClient()
  6. ssh.load_system_host_keys()
  7. ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  8. ssh.connect(ip,username=username,password=password)
  9. except Exception as err:
  10. print err
  11.  
  12. while True: #while time.time() - start < 3:
  13. if session.recv_ready():
  14. data = session.recv(1024)
  15. sys.stdout.write(data)
  16. sys.stdout.flush() # Flushing is important!
  17. time.sleep(0.001) # Yield CPU so we don't take up 100% usage...
  18. sys.stdout.write('n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement