bakalarska_praca/public/enroll_raspberrypi.py

27 lines
522 B
Python
Raw Permalink Normal View History

2023-05-11 19:57:12 +00:00
import paramiko
import sys
import warnings
warnings.filterwarnings("ignore", category=ResourceWarning)
user_id = sys.argv[1]
input_str = f'{user_id}\n'
command = 'python3 /home/realsense/test/enroll.py ' + input_str
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('10.8.0.2', username='realsense', password='realsense')
stdin, stdout, stderr = ssh.exec_command(command)
stdin.write(input_str)
stdin.flush()
stdin.close()
print(stdout.read().decode())
ssh.close()