python报错string indices must be integers解决如下:
在.py文件中写的data={"a":"123","b":"456"},data类型为dict
而在.py文件中通过data= arcpy.GetParameter(0) 获取在GP中传过来的参数{"a":"123","b":"456"},data类型为字符串。
所以在后续的.py中用到的data['a']就会报如上错误。
python报错string indices must be integers解决如下:
在.py文件中写的data={"a":"123","b":"456"},data类型为dict
而在.py文件中通过data= arcpy.GetParameter(0) 获取在GP中传过来的参数{"a":"123","b":"456"},data类型为字符串。
所以在后续的.py中用到的data['a']就会报如上错误。