什么是变量的类型

phi*_*ext 1 python soappy

我是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)
Run Code Online (Sandbox Code Playgroud)

结果是:

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'}]
Run Code Online (Sandbox Code Playgroud)

我试着理解我的ss变量是什么类型(print(type(ss))得到的SOAPpy.Types.typedArrayType对我来说不是很清楚)?如何为城市或街道设置一个简单的变量?

Pra*_*yak 5

你可以这样做type(variable name).