GetParameterAsText在Python2.7中返回的是unicode吗?


featurename = arcpy.GetParameterAsText(0)
arcpy.AddMessage(type(featurename))
我打印出来是unicode
已邀请:

许丹石

赞同来自:

GetParameterAsText,返回的是文本,在python2.7中,字符串一般有两种类型,unicode和str。其中unicode 更为常用,比如三个汉字的长度u'三汉字' 的len() 为3. 而str如果是utf8编码,三个汉字的长度为9

要回复问题请先登录注册