laptop and a wrench

Bogue

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

Dernière publication: August 25, 2014 No Product Found
Numéro d’ID de bogue NIM035241
EnvoiMay 14, 2008
Dernière modificationJune 5, 2024
S’applique àNo Product Found
Version trouvée9.2
StatutNon-Reproducible

Informations supplémentaires

No Public Explanation

Solution de contournement

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~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Étapes pour reproduire

ID de bogue: NIM035241

Logiciel:

  • No Product Found

Recevoir une notification lorsque le statut d’un bogue change

Télécharger l’application Esri Support

En savoir plus sur ce sujet

Obtenir de l’aide auprès des experts ArcGIS

Contacter le support technique

Télécharger l’application Esri Support

Accéder aux options de téléchargement