- Support Home >
- Knowledge Base >
- Technical Articles >
- Article Detail
FAQ: Changes in List methods for Python with ArcGIS 9.3
| Article ID: | 34873 |
|---|---|
| Software: | ArcGIS - ArcEditor 9.3, 9.3.1 ArcGIS - ArcInfo 9.3, 9.3.1 ArcGIS - ArcView 9.3, 9.3.1 |
| Platforms: | Windows XP |
Question
Answer
ArcGIS 9.3 now produces Python Lists that do not require Next and Reset. Below is an example of the differences.
Current scripts that utilize the 9.2 version are not effected.
These changes effect the following methods:
ListFields()
ListIndexes()
ListDatasets()
ListFeatureClasses()
ListRasters()
ListTables()
ListWorkspaces()
ListEnvironments()
ListToolboxes()
ListTools()
ListInstallations()
ArcGIS 9.2 ListFeatureClasses:
import arcgisscripting
gp = arcgisscripting.create()
gp.workspace = r"D:\Data"
fcS = gp.ListFeatureClasses()
fc = fcS.Next()
while fc:
print fc
fc = fcS.Next()
ArcGIS 9.3 ListFeatureClasses:
import arcgisscripting
gp = arcgisscripting.create(9.3)
gp.workspace = r"D:\Data"
fcS = gp.ListFeatureClasses()
for fc in fcS:
print fc
Created: 5/22/2008
Last Modified: 10/5/2009