I'm trying to process images from my camera on my server and get the information after processing on my local machine in real-time. I can get necessary information as terminal outputs on my server, but I can't put this info in my python code on local machine, until my server program is running. I'm tried this code:
cmd="sshpass -p 'pass' ssh -Y user@ip -t 'process_image; bash -l'"
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, bufsize=1)
for line in iter(p.stdout.readline, b''):print(line)p.stdout.close()p.wait()
But it doesn't work - it looks like this code just paused my program. I tried to write output to file and than read file from local machine, but it distorts my data. What can i do to read terminal output from server in real-time?