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?
Asked
Active
Viewed 83 times
1
-
Do you have ssh access to Raspberry Pi? – Samuel May 20 '16 at 00:02
-
sure i do, i thought of that too, just not sure how to make both programs talk – aero May 20 '16 at 00:04
1 Answers
1
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()

Samuel
- 3,631
- 5
- 37
- 71
-
Please check this topic to choose library that suits you best: http://stackoverflow.com/questions/995944/ssh-library-for-java – Samuel May 20 '16 at 01:54