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

猜你喜欢

转载自www.cnblogs.com/gisoracle/p/11785622.html