Some additional observations and run times (HH:MM:SS).
I ran the python script in 3 ways:
1. Using the Windows Command Prompt window. 00:03:43
2. From within PyScripter (no debugging, just a straight run using Run command). 1:21:33
3. Using the Windows Command Prompt Window, but I happended to have the python script open in PyScripter at the same time. 1:21:33
Note: Scenario 3 was the most interesting as it ran just as slow as scenario 2. The only difference being that the python file was open in PyScripter while trying to run from Windows Command Prompt. But if the python script was open in IDLE or Notepad while attempting to run from the Windows Command Prompt, it ran just as fast as in scenario 1 with in a few seconds.
I also noticed under the Run > Python Engine menu, there are 4 options: Internal, Remote, Remote (Tk), and Remote (Wx). By default PyScripter has selected Remote. The following website explained the different options and limitations http://code.google.com/p/pyscripter/wiki/RemoteEngines. So I tried changing it to Internal from Remote. But that just made it worse, as the program never seemed to get through the first step and PyScripter went into Not Responding mode as I was forced to exit the application.
I am telling my impression about working with PyScripter running ArcGIS scripts.
I was programming a large process (took about 5-7 minutes). Everything was OK because the time of execution was more or less the same inside or outside ArcGIS.
After running several times the script, I notice that PyScripter had become too slow, even for a simple and easy step. I don't know if something is beeing storing somewhere or whatever, but the thruth is that the script run slower!
I decided to try on another computer, so I prepared PyScripter and execute. The same. At the beginning, the execution time was really fast, but after a few tries, the time of running the script became again too slow.
Any idea?
The engine I'm using is "Remote"
After running my script step by step, I got possible solutions.
One was that arcpy.Exist() take to much if the path has a lot of files! It's faster to use os.path.exist()
I have modified the script in order to avoid a directory increasing and increasing with new files every minute, and takes longer to read with arcpy.
>>> import arcpy, os >>> fc = r'\\Arcserver1\gis\RICO\M23106103\ESRI\Themes\Connections\Connections.gdb\Connection_Parcels' >>> shp = r'\\Arcserver1\gis\RICO\_Basemap\ESRI\Themes\Soils\Rico_Soils.shp' >>> for feat in [shp, fc]: print '{0} Exists according to arcpy: {1}'.format(os.path.basename(feat), arcpy.Exists(feat)) print '{0} Exists according to os: {1}'.format(os.path.basename(feat), os.path.exists(feat)) Rico_Soils.shp Exists according to arcpy: True Rico_Soils.shp Exists according to os: True Connection_Parcels Exists according to arcpy: True Connection_Parcels Exists according to os: False