当前位置: 首页>>代码示例>>Python>>正文


Python ServerProxy.twice方法代码示例

本文整理汇总了Python中xmlrpclib.ServerProxy.twice方法的典型用法代码示例。如果您正苦于以下问题:Python ServerProxy.twice方法的具体用法?Python ServerProxy.twice怎么用?Python ServerProxy.twice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在xmlrpclib.ServerProxy的用法示例。


在下文中一共展示了ServerProxy.twice方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: ServerProxy

# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import twice [as 别名]
'''
Created on Mar 31, 2016

@author: walchen
'''
from xmlrpclib import ServerProxy

if __name__ == '__main__':
    proxy = ServerProxy('http://10.68.127.125:4242')
    print proxy.twice(2)
开发者ID:chptcleo,项目名称:PythonPractice,代码行数:12,代码来源:simple_request.py

示例2: ServerProxy

# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import twice [as 别名]
#!/usr/bin/env python
from xmlrpclib import ServerProxy
s = ServerProxy('http://127.0.0.1:9000')
print s.twice(2)
开发者ID:onlyjackma,项目名称:little_tools,代码行数:6,代码来源:rpccli.py

示例3: len

# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import twice [as 别名]
from xmlrpclib import ServerProxy,Fault
import socket
import sys

port = 12345
if len(sys.argv)>=2:
	port = int(sys.argv[1])

ip = 'localhost'
url = 'http://{0}:{1}'.format(ip,port)
s = ServerProxy(url,allow_none=True)
try:
	print(s.twice(2)) # Call a fictive method.
	data = s.hello()
	print('data from hello')
	print(data)
	#print(s.xxx()) # not exist
except Fault:
        # connected to the server and the method doesn't exist which is expected.
	print('Connected to server but the method does not exist')
        pass
except socket.error:
        # Not connected ; socket error mean that the service is unreachable.
	print('Can not connect to server')

开发者ID:justasabc,项目名称:python_tutorials,代码行数:26,代码来源:c.py


注:本文中的xmlrpclib.ServerProxy.twice方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。