paramiko
import paramiko class SCPClient(paramiko.SSHClient): def read_response(self, stdout): c = ord(stdout.read(1)) if c == 0: return if c == -1: raise paramiko.SSHException("Remote scp terminated unexpectedly") if c != 1 and c != 2: raise param…