A simple (130 loc), one-file Python RPC System that is based on Streams allowing for cross-language/SSH usage.
This is a port of the nodejs RPC system by @dominictarr.
# -*- coding: utf-8 -*-from rpycstream import RPCfrom subprocess import Popen, PIPE, STDOUT# pythonworker =# nodejs# worker = Popen(['ssh', 're.mo.te.ip', 'node', 'remote.js'], stdout=PIPE, stdin=PIPE, stderr=STDOUT)# pipe into each otherrpc =# remote callremote =# which is equivalent toif err:raise errprint "msg:", msgif __name__ == '__main__':
var cp = ;var rpc = ;// nodejsvar worker = cp;// python// var worker = cp.exec('ssh re.mo.te.ip python remote.py');var client = ;client;workerstdout;client;
# -*- coding: utf-8 -*-from rpycstream import RPCreturn '%s was bitten by a python' % nameif __name__ == '__main__':rpc =
// seevar rpc = ;var server =;server;processstdin;
Marcel R. (riga)