发布时间:2019-09-24 08:27:17编辑:auto阅读(2276)
例子:
Python RPC Server
import SimpleXMLRPCServer
class MyObject:
def sayHello(self):
return "hello ZQF, That is xmlprc Respond."
obj = MyObject()
server = SimpleXMLRPCServer.SimpleXMLRPCServer(("localhost", 80))
server.register_instance(obj)
print "Listening on port 80"
server.serve_forever()
Python RPC Client
import xmlrpclib
server = xmlrpclib.ServerProxy("http://localhost:80")
words = server.sayHello()
print "result:" + words
上一篇: go语言调用python
下一篇: Python学习:使用urllib模块读
47776
46290
37179
34669
29262
25920
24808
19896
19456
17952
5747°
6352°
5865°
5917°
7018°
5853°
5878°
6384°
6343°
7712°