pyjsonrpc模块使用
2018-07-04 22:25
1481 查看
pyjsonrpc模块的远程过程调用方法。
# -*- coding:utf-8 -*- #!/usr/bin/env python2.7 # @Author : tianbao # @Contact : gmu1592618@gmail.com # @Time : 2018/7/4 21:49 # @File : aastest.py # @Software: PyCharm import pyjsonrpc class RequestHandler(pyjsonrpc.HttpRequestHandler): @pyjsonrpc.rpcmethod def add(self, a, b): """Test method""" return a + b # Threading HTTP-Server http_server = pyjsonrpc.ThreadingHttpServer( server_address = ('localhost', 8080), # 监听地址 RequestHandlerClass = RequestHandler ) print "Starting HTTP server ..." print "URL: http://localhost:8080" http_server.serve_forever() # 启动server
相关文章推荐
- ASP.net Joyrock异步应用示例、JSON-RPC使用方法
- 使用python的logging模块 && py转换成exe
- gRPC java 客户端,服务器端通讯使用json格式
- 使用JSON-RPC-Java完成Ajax交互
- Python json模块使用实例
- 详解Python使用simplejson模块解析JSON的方法
- 开发android4.0以上版本网络编程模块的问题 使用URLConnection 怎么连接不上 获取Json字符串
- JSON-RPC组件的使用
- Python time、datetime、os、random、sys、hashlib、json、shutil、logging、paramiko、subprocess、ConfigParser、xml、shelve模块的使用
- WEB开发中,使用JSON-RPC好,还是RESTful API好?
- JSON-RPC轻量级远程调用协议介绍及使用
- python-json模块简单使用
- WEB开发中,使用JSON-RPC好,还是RESTful API好?
- JSON-RPC轻量级远程调用协议介绍及使用
- 使用xml-rpc调试openerp模块中的函数
- 在dojo中使用JSON-RPC
- JSON-RPC轻量级远程调用协议介绍及使用
- perl6 JSON::Fast模块json解析的使用
- [py]logutils 给人用的日志记录模块-支持json格式
- 使用json-rpc实现delphi+java异构语言RPC调用