zoukankan      html  css  js  c++  java
  • Python 自带 RPC Demo

    Python 自带 RPC Demo

    Server.py:

    1. from SimpleXMLRPCServer import SimpleXMLRPCServer    
    2. def fun_add(a,b): 
    3.     totle = a + b  
    4.     return totle 
    5. if __name__ == '__main__': 
    6.     s = SimpleXMLRPCServer(('0.0.0.0', 8080))   #开启xmlrpcserver 
    7.     s.register_function(fun_add)                #注册函数fun_add 
    8.     print "server is online..." 
    9.     s.serve_forever()                           #开启循环等待 

    Client.py:

    1. from xmlrpclib import ServerProxy            #导入xmlrpclib的包 
    2. s = ServerProxy("http://172.171.5.205:8080") #定义xmlrpc客户端 
    3. print s.fun_add(2,3)        
  • 相关阅读:
    C#Webform 控件
    C#Webform
    MVC Razor 语法
    input file 添加
    ajax
    jquery动画
    jquery选择器,事件 dom操作
    linq 复杂查询
    webform(linq增删改查)
    asp.net内置对象
  • 原文地址:https://www.cnblogs.com/fengff/p/13497422.html
Copyright © 2011-2022 走看看