linux - Running python in the background and feeding data -


i have python setup using objects can perform specific tasks i2c protocol. rather having script create objects , run single task when run command line command, there way have objects 'stay alive' in background , somehow feed program new data command line?

the general idea have running on remote pc , use ssh send commands (new data) on program.

one idea had have program check (infinite loop) data file containing set of tasks perform , run when exists. seems go awry if sftp new data file on because program reading 1 exists , cause undesirable effects.

i'm sure there many better ways go task this, appreciated.

you can try , use client-server or sockets approach. remote pc has server running listening commands or data coming into. client or local computer can send commands on port , ip remote pc listening to. server parses data coming in, looks @ whatever commands have defined , executes them accordingly.


Comments