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


Python ServerProxy.echo方法代码示例

本文整理汇总了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
开发者ID:tianshangjun,项目名称:cloudstack,代码行数:10,代码来源:simple_pool.py

示例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))
开发者ID:sakurahilljp,项目名称:pyraspi,代码行数:12,代码来源:xmlrpcclient.py

示例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)
开发者ID:danger89,项目名称:daeso-dutch,代码行数:33,代码来源:graph_align_client.py

示例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')

开发者ID:henry-spinitalia,项目名称:alma_tcp_server,代码行数:9,代码来源:xml-rpc_client_auth.py


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