本文整理汇总了Python中xmlrpclib.ServerProxy.echo方法的典型用法代码示例。如果您正苦于以下问题:Python ServerProxy.echo方法的具体用法?Python ServerProxy.echo怎么用?Python ServerProxy.echo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xmlrpclib.ServerProxy
的用法示例。
在下文中一共展示了ServerProxy.echo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: spCon
# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import echo [as 别名]
def spCon(proto, auth, host, port):
print "trying %s on %[email protected]%s:%s" % (proto, auth, host, port)
try:
x = ServerProxy("%s://%[email protected]%s:%s" % (proto, auth, host, port))
x.echo(proto)
return x
except Error, v:
return
示例2: main
# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import echo [as 别名]
def main():
proxy = ServerProxy('http://localhost:{}'.format(PORT))
# Print list of available methods
print proxy.system.listMethods()
proxy.log('xmlrpcclient', 19.89)
print repr(proxy.echo('echo'))
print repr(proxy.echo(100))
print repr(proxy.echo(1.23))
示例3: raw_input
# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import echo [as 别名]
# (which Python's XML-RPC knows how to handle/transport)
inp = raw_input(prompt)
return inp.decode(options.input_encoding)
def _write(out):
# converts a string in the dict returned by the "align" method on the
# server proxy object, which can be either a plain ascii string or a
# unicode string, to the specified output encoding
print out.encode(options.output_encoding)
server_proxy = ServerProxy("http://" + options.host, encoding="utf-8")
try:
assert server_proxy.echo("test") == "test"
except Exception, inst:
if isinstance(inst, socket.error):
print >>sys.stderr, "ERROR: cannot connect to graph align server"
raise inst
while True:
try:
source_sent = _read("Source sentence? : ")
target_sent = _read("Target sentence? : ")
except (KeyboardInterrupt, EOFError):
exit(0)
try:
result = server_proxy.align(source_sent, target_sent)
示例4: ServerProxy
# 需要导入模块: from xmlrpclib import ServerProxy [as 别名]
# 或者: from xmlrpclib.ServerProxy import echo [as 别名]
from xmlrpclib import ServerProxy
if __name__ == '__main__':
#p = ServerProxy('http://localhost:8080')
#p
p = ServerProxy('http://spinitalia:[email protected]:8080')
p.echo('hi')