『高级篇』docker之Python开发信息服务(11)
发表于:2024-10-06 作者:千家信息网编辑
千家信息网最后更新 2024年10月06日,原创文章,欢迎转载。转载请注明:转载自IT人故事会,谢谢!原文链接地址:『高级篇』docker之Python开发信息服务(11)信息服务准备用python来写,在现有的idea中添加python的模块
千家信息网最后更新 2024年10月06日『高级篇』docker之Python开发信息服务(11)
原创文章,欢迎转载。转载请注明:转载自IT人故事会,谢谢!
原文链接地址:『高级篇』docker之Python开发信息服务(11)信息服务准备用python来写,在现有的idea中添加python的模块。源码:https://github.com/limingios/msA-docker
idea安装python插件
安装后重新idea。
安装python模块
安装thrift的pyhon插件
开始我用idea写python,下载个插件都费劲,我换成了pycharm来写美滋滋
- 编辑Python的服务代码
# coding: utf-8from message.api import MessageServicefrom thrift.transport import TSocketfrom thrift.transport import TTransportfrom thrift.protocol import TBinaryProtocolfrom thrift.server import TServerclass MessageServiceHandler: def sendMobileMessage(self, mobile, message): print ("sendMobileMessage, mobile:"+mobile+", message:"+message) return True def sendEmailMessage(self, email, message): print ("sendEmailMessage, email:"+email+", message:"+message) return Trueif __name__ == '__main__': handler = MessageServiceHandler() processor = MessageService.Processor(handler) transport = TSocket.TServerSocket(None, "9090") tfactory = TTransport.TFramedTransportFactory() pfactory = TBinaryProtocol.TBinaryProtocolFactory() server = TServer.TSimpleServer(processor, transport, tfactory, pfactory) print ("python thrift server start") server.serve() print ("python thrift server exit")
- 查看端口已经启动
- 生成对应java 和python的命令
都是根据thrift文件,生成对应的上级目录
thrift --gen py -out ../ message.thriftthrift --gen java -out ../ message.thrift
PS:thrift的开发流程是: 先定义thrift的文件,然后通过命令生成对应的python代码。通过实现定义的thrift方法,来完成thrift的调用。
服务
插件
生成
信息
开发
代码
命令
文件
模块
高级
费劲
上级
原创文章
原文
地址
故事
故事会
文章
方法
流程
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
企业应用软件开发好不好
蚂蚁金服数据库使用方式
sql用odbc连接数据库
奇安信网络安全攻防演练总结
广州net软件开发哪家可靠
上虞民宿软件开发
裸金属服务器属于什么
中国最大的ai服务器
软件开发渐增模式
数据库计算
网络技术培训前景
电脑无线网络安全类型设置
pgsql数据库分页
团团服务器
智微智能服务器主板咋样
luckperm如何连接数据库
网络技术证书的条件
计算机软件开发从业建议
公安部网络安全大队是什么单位
普陀区海航数据库服务商报价行情
诺顿网络安全
软件开发过程中涉及到哪些角色
中铁信北京网络技术研究院
首页财经网络安全大会
html表单数据库怎么连接
专业订制app软件开发价格
爱立信 软件开发工程师
互联网科技创新书籍
网络安全等安全教育
采购结算业务流程图带数据库