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
相關文章
相關標籤/搜索