Skip to main content
 首页 » 编程设计

python之变量的类型是什么

2025年05月04日15luoye11

我是 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)) get SOAPpy.Types.typedArrayType 这对我来说不是很清楚)? 以及如何为城市或街道提供一个简单的变量?

请您参考如下方法:

你可以只做 type(variable name)。