python TypeError: unsupported operand type(s) for +: 'geoprocessing value object' and

python TypeError: unsupported operand type(s) for +: 'geoprocessing value object' and 'str'

 
TypeError: unsupported operand type(s) for +: 'geoprocessing value object' and 'str' 
 if self.params[0].value:
        mypath=self.params[0].value #
        cpath=mypath+os.sep+dataset
        arcpy.env.workspace =cpath
修改如下:
 if self.params[0].value:
        mypath=str(self.params[0].value) #
        cpath=mypath+os.sep+dataset
        arcpy.env.workspace =cpath

 

   

 

上一篇:判断文件是否存在的shell脚本代码!


下一篇:WPF使用Path在C#后台使用代码画线,动态添加至canvas