Monday, 4 May 2015

Python IDEs (PyScripter,PythonWin) crashing when installed with ArcGIS for Desktop?


I am learning Python, so here is a real newbie question!


Everything writen in ArcGis Python's windows is working fine. The same lines, correctly writen in an IDE, when run, are crashing it.


Working on ArcGis 10.2 using Python 2.7.5, 32 bits, Windows 7


IDE:


PythonWin32 (pywin32-218.win32-py2.7)

PyScripter (PyScripter-v2.5.3-Setup.exe)


For PyScripter I get a message Windows Error "python.exe is not working" followed by aPyScripter message: "EOFError: [Errno 10054] An existing connection was forcibly closed by the remote host" . Internet searches didn't get an answer I could understand.


For PythonWin, it just stops and crashs.


Installations path are as followed (by default): Python 27: C:\


PythonWin: C:\Python27\ArcGIS10.2\Lib\site-packages\pythonwin


PyScripter: C:\Program Files (x86)\PyScripter


I suppose these issues have been met before and solve... So what I am missing here? some other packages or libraries? What would you advice me to use to script in Python?


For info my lines are:


import arcpy


from arcpy import env

env.workspace = "D:/_PYTHON/Python/Data/Exercise07"

fc = "Results/airports.shp"

delimfield = arcpy.AddFieldDelimiters(fc, "STATE")

cursor = arcpy.da.UpdateCursor(fc, ["STATE"], delimfield + " = 'AK'")


for row in cursor:

row[0] = "AK2"

cursor.updateRow(row)

del row

del cursor


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...