什么是变量的类型
我是Python的新手我有以下代码:
from SOAPpy import WSDL
fichier_wsdl = 'http://geocoder.us/dist/eg/clients/GeoCoder.wsdl'
wsdl = WSDL.Proxy(fichier_wsdl)
callInfo = wsdl.methods['geocode']
ss = wsdl.geocode('1600 Pennsylvania Ave, Washington, DC.')
print(ss)
结果是:
IMPORT: http://schemas.xmlsoap.org/soap/encoding/
no schemaLocation attribute in import
<<class 'SOAPpy.Types.typedArrayType'> results at 21824752>: [<SOAPpy.Types.structType item at 21818984>: {'city': 'Washington', 'prefix': '', 'suffix': 'NW', 'zip': 20502, 'number': 1600, 'long': -77.037684, 'state': 'DC', 'street': 'Pennsylvania', 'lat': 38.898748, 'type': 'Ave'}]
我试着理解我的ss变量是什么类型(print(type(ss))得到的SOAPpy.Types.typedArrayType对我来说不是很清楚)?
如何为城市或街道设置一个简单的变量?
没有找到相关结果
已邀请:
2 个回复
社攻取墟槽
它告诉你你的变量是什么类型的:
...尝试阅读SOAPpy文档来理解(我是一个非SOAP用户,甚至不是新手)。 您真正想知道的是如何使用该结果。在我看来,如果你做
,你可以访问这样的字段:
应该产生
等 所以你可以做到
请注意,具有花哨类型的
看起来像列表...如果您的查询有多个答案(检查
),您将需要迭代列表:
臀博
。