输出每个字段的名称,类型和长度

import arcpy
… from arcpy import env
… env.workspace = “I:\pystudy\shili”
… fieldlist = arcpy.ListFields(“fydltb.shp”)
… for field44 in fielist:
…     print “{0} is a type of {1} with a lengh of {2}” .format(field44.name,field44.type,field44.length)
…     
FID is a type of OID with a lengh of 4
Shape is a type of Geometry with a lengh of 0
BSM is a type of Integer with a lengh of 9
YSDM is a type of String with a lengh of 10
TBYBH is a type of String with a lengh of 8
TBBH is a type of String with a lengh of 8
DLBM is a type of String with a lengh of 4
DLMC is a type of String with a lengh of 60
QSXZ is a type of String with a lengh of 3
QSDWDM is a type of String with a lengh of 19
QSDWMC is a type of String with a lengh of 60
ZLDWDM is a type of String with a lengh of 19
ZLDWMC is a type of String with a lengh of 60
GDLX is a type of String with a lengh of 2
KCLX is a type of String with a lengh of 2
DLBZ is a type of String with a lengh of 10
GDPDJ is a type of String with a lengh of 2
KCDLBM is a type of String with a lengh of 4
TKXS is a type of Double with a lengh of 19
TBMJ is a type of Double with a lengh of 19
XZDWMJ is a type of Double with a lengh of 19
LXDWMJ is a type of Double with a lengh of 19
TKMJ is a type of Double with a lengh of 19
TBDLMJ is a type of Double with a lengh of 19
PZWH is a type of String with a lengh of 254
BGJLH is a type of String with a lengh of 20
BGRQ is a type of Date with a lengh of 8
XZGDJFLY is a type of String with a lengh of 50
OBJECTID is a type of Integer with a lengh of 9
TBMJ_DIST is a type of Double with a lengh of 19
shape_Leng is a type of Double with a lengh of 19
shape_Area is a type of Double with a lengh of 19
 

转载自:https://blog.csdn.net/qq_36196621/article/details/86539171

You may also like...