本文整理汇总了Python中SOAPpy.SOAPProxy.getQuote方法的典型用法代码示例。如果您正苦于以下问题:Python SOAPProxy.getQuote方法的具体用法?Python SOAPProxy.getQuote怎么用?Python SOAPProxy.getQuote使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SOAPpy.SOAPProxy
的用法示例。
在下文中一共展示了SOAPProxy.getQuote方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Copyright
# 需要导入模块: from SOAPpy import SOAPProxy [as 别名]
# 或者: from SOAPpy.SOAPProxy import getQuote [as 别名]
#!/usr/bin/env python
# Copyright (c) 2001 actzero, inc. All rights reserved.
ident = '$Id: quoteTest.py,v 1.5 2003/12/18 06:31:50 warnes Exp $'
import os, re
import sys
sys.path.insert(1, "..")
from SOAPpy import SOAPProxy
# Three ways to do namespaces, force it at the server level
server = SOAPProxy("http://services.xmethods.com:9090/soap",
namespace = 'urn:xmethods-delayed-quotes')
print "IBM>>", server.getQuote(symbol = 'IBM')
# Do it inline ala SOAP::LITE, also specify the actually ns
server = SOAPProxy("http://services.xmethods.com:9090/soap")
print "IBM>>", server._ns('ns1',
'urn:xmethods-delayed-quotes').getQuote(symbol = 'IBM')
# Create a namespaced version of your server
dq = server._ns('urn:xmethods-delayed-quotes')
print "IBM>>", dq.getQuote(symbol='IBM')
print "ORCL>>", dq.getQuote(symbol='ORCL')
print "INTC>>", dq.getQuote(symbol='INTC')
示例2: SOAPProxy
# 需要导入模块: from SOAPpy import SOAPProxy [as 别名]
# 或者: from SOAPpy.SOAPProxy import getQuote [as 别名]
sys.path.insert(1, "..")
from SOAPpy import SOAPProxy
# Check for a web proxy definition in environment
try:
proxy_url = os.environ["http_proxy"]
phost, pport = re.search("http://([^:]+):([0-9]+)", proxy_url).group(1, 2)
proxy = "%s:%s" % (phost, pport)
except:
proxy = None
# Three ways to do namespaces, force it at the server level
server = SOAPProxy("http://services.xmethods.com:9090/soap", namespace="urn:xmethods-delayed-quotes", http_proxy=proxy)
print "IBM>>", server.getQuote(symbol="IBM")
# Do it inline ala SOAP::LITE, also specify the actually ns
server = SOAPProxy("http://services.xmethods.com:9090/soap", http_proxy=proxy)
print "IBM>>", server._ns("ns1", "urn:xmethods-delayed-quotes").getQuote(symbol="IBM")
# Create a namespaced version of your server
dq = server._ns("urn:xmethods-delayed-quotes")
print "IBM>>", dq.getQuote(symbol="IBM")
print "ORCL>>", dq.getQuote(symbol="ORCL")
print "INTC>>", dq.getQuote(symbol="INTC")