>>> import arcpy
>>> arcpy.env.workspace=r'F:\arcpy_data\钦州市'
>>> flds=arcpy.ListFields(r'兴趣点.shp')#获取要素类的字段列表
>>> fld=flds[0]#获取第一个字段
>>> print fld.name,fld.type,fld.length#打印字段名称、类型和长度
FID OID 4#输出结果
>>> for fld in flds:
... print fld.name,fld.type,fld.length#通过循环打印所有的字段名称、类型和长度
...
输出结果:
FID OID 4
Shape Geometry 0
OBJECTID Double 10
osm_id String 10
code Double 10
fclass String 28
name String 100
POINT_X Double 19
POINT_Y Double 19
使用pycharm输出: