laptop and a wrench

漏洞

ListRasters function syntax returns nothing in Python 2.4, but works as expected in Python 2.1.

上次发布: August 25, 2014 No Product Found
漏洞 ID 编号 NIM035241
已提交May 14, 2008
上次修改时间June 5, 2024
适用范围No Product Found
找到的版本9.2
状态Non-Reproducible

附加信息

No Public Explanation

解决办法

Changing gp.ListRasters("*", "TIFF") to gp.ListRasters("*", "TIF") seems to have fixed the problem in some cases. Here is the code that seems to works every time in Python 2.4 :~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#import win32com.client, sys, string, os#gp = win32com.client.Dispatch("esriGeoprocessing.GPDispatch.1")import arcgisscripting, sysgp = arcgisscripting.create()gp.setproduct("arcinfo")gp.workspace = r"<a href="file:C:/TEMP" target="_blank">C:\TEMP</a>"# Get a list of grids in the workspace.rasters = gp.ListRasters("*", "TIF")raster = rasters.next()while raster: print raster raster = rasters.next()del gp~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

重现步骤

漏洞 ID: NIM035241

软件:

  • No Product Found

当漏洞状态发生变化时获得通知

下载 Esri 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项