I am new to coding in python and specifically Arcpy. Through trial and error I was able to piece together this code that was working fine yesterday until I installed service pack 5 for ArcGIs Desktop 10.0, on a 64 bit Windows machine. The reason I decided to install this service pack is because the code was incapable of doing more than ~60 iterations of the loop without stopping unless everything on my machine was closed except ArcCatalog. I saw on a discussion board that updating to a new service pack might solve my problem. Now my problems is the machine crashing halfway through one loop.
Through trial and error I have determined that using the line of my code which calls on the FeatureClassToFeatureClass_conversion crashes ArcCatalog. The only thing that I can trace the problem back to is upgrading to service pack 5.
import arcpy
arcpy.env.scratchWorkspace=r'C:\Users\fk128474\Documents\Freds_Bitterroot_Model\wrf_data\Scratch'
arcpy.env.workspace=r'C:\Users\fk128474\Documents\Freds_Bitterroot_Model\wrf_data\2001_LW'
import os
xcelFiles = arcpy.ListFiles('*.xls')
count = 1
arcpy.env.workspace=r'C:\Users\fk128474\Documents\Freds_Bitterroot_Model\wrf_data\2001_LW'
for count in range(0, 140):
fileName = xcelFiles[count]
tableName = fileName[:-4] + '_Table_View'
layerName = fileName[:-4] + 'Point_Layer'
xyName = fileName[:-4] + '_pts'
tempName = 'LW' + fileName[11:-4]
shpPath = r'C:\Users\fk128474\Documents\Freds_Bitterroot_Model\wrf_data\2001_LW\Shape'
spRef = r"Coordinate Systems\Geographic Coordinate Systems\World\WGS 1984.prj"'
points = arcpy.MakeTableView_management(fileName + '\\sheet1$', tableName)
b = arcpy.MakeXYEventLayer_management(points,"F2","F3",tempName, spRef, "F4")
arcpy.FeatureClassToFeatureClass_conversion (b, shpPath, tempName)
I have not included the rest of my code as this last line causes the program to crash.
Thanks
Fred
