Version 2 (modified by Sung-jin Hong, 12 years ago) (diff)


Simply see [XML-RPC] . Use the SimpleJSONRPCServer instead of SimpleXMLRPCServer and you are done!

You'll also want JSON RPC Client too.

$ cat 
import sys
import jsonrpclib
rpc_srv = jsonrpclib.ServerProxy("http://localhost:8000/json_rpc_srv/")
result = rpc_srv.multiply( int(sys.argv[1]), int(sys.argv[2]))
print "%d * %d = %d" % (int(sys.argv[1]), int(sys.argv[2]), result['result'])

There you go!

Another power of python here!

Back to Top