You need to make a ssh Brush command
class Mcu:
def init(self):
self.ssh_client = paramiko.SSHClient()
self.ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy)
self.ssh_client.connect(hostname='', port=22, username='t', password='2')
print(' Successful connection ')
def WriteMcu_A(self): # stdin Command entered for # stdout The result returned for the command # stderr Is the result returned in case of command error stdin, stdout, stderr = self.ssh_client.exec_command(' View version ') # cmd Carry out orders result = stdout.read().decode('utf-8') # Read the execution result print(result) self.version = re.findall("version::.+", result) print(self.version) print(" First step ") stdin, stdout, stderr = self.ssh_client.exec_command( Specified file ) result = stdout.read().decode('utf-8') # Read the execution result print(result) print(" The second step ") stdin, stdout, stderr = self.ssh_client.exec_command(' Execute the command to start writing ') print(" The third step ") ## Here you need to show the progress of the brush ,percent == [100.00] and result == [0] The time brush is completed #time.sleep(3000) results = stdout.read().decode('utf-8') print(results) # percent = re.findall("percent:n:.+", results) # result = re.findall(" result:n:.+", results) # print(percent,result) # if percent == [100.00]: # if result == [0]: stdin, stdout, stderr = self.ssh_client.exec_command(' Swipe complete ') result = stdout.read().decode('utf-8') # Read the execution result print(result) print(" Step four ") self.ssh_client.close()
explain : This is a practical
Because the recent test needs