My question contains more details, but the bottom line is that I need a general idea of how to call my other Python program (or functions) from another program on another computer, what do i need (i.e. Sockets?) What I'm doing is building a Python UI application, this application shall connect to a Raspberry Pi Python GPIO script running on the RPi to control pins (i.e LED's), I'm not sure if these details are relevant, but most importantly is how to basically make the two programs talk to each other?
1 Answer
Paramiko library could be one of the solutions here:
import paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(host, username=username, password=password, port=port, timeout=30) # setting up ssh connection
ssh.exec_command('<Execute Your Remote Script here>')
ssh.close()
1 Comment
Samuel
Please check this topic to choose library that suits you best: stackoverflow.com/questions/995944/ssh-library-for-java