Frank-
How are you trying to run the script?
Are you trying to use a front-end through ArcTool box, running it from the command line, or running it in PythonWin?
All three should be roughly equivalent, however, it sounds like you trying to Access the script the Toolbox or Model Builder and ArcGIS is interpreting the script as being a _vbscript_ and not python.
Send me a private e-mail and we can discuss this some more (and I will bring my training materials to the office tommorrow), but I don' t think this is an issue for the general list, as it is an ESRI issue and not a Python issue.
HTH-
Eric
Eric B. Powell
Bechtel Savnnah River Inc.
(803) 557-6612
"Frank Peacock"
<[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED] 11/07/2005 10:34 AM
|
|
Hello
I am running a python script which calls an ESRI ArcGIS COM function called
calculatefield. If the text variable I pass to this function is longer than
10 characters I get the following error: "Microsoft _vbscript_ compilation
error - expected end of statement". I do not know what I need to do to solve
this problem. I have installed the latest WSH 5.6 but to no avail.
The following is my code:
# --------------------------------------------------------------------------
-
# Create Time Field.py
# Created on: Sun Nov 06 2005 11:37:26 PM
# (generated by ArcGIS/ModelBuilder)
# --------------------------------------------------------------------------
-
# Import system modules
import sys, string, os, win32com.client
# Create the Geoprocessor object
gp = win32com.client.Dispatch("esriGeoprocessing.GpDispatch.1")
gp.SetProduct("ArcView")
# Load required toolboxes...
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management
Tools.tbx")
# Local variables...
gp.workspace = "C:\\GIS_DATA\\Satellite\\CLAUS\\I2-235\\"
try:
fas=gp.ListFeatureClasses("*","POLYGON")
fas.reset()
fa=fas.next()
while fa:
text=fa[0:11]
print text
# Process: Calculate Field...
gp.CalculateField_management(fa, "Time", text)
fa=fas.next()
except:
gp.AddMessage(gp.GetMessages(2))
print gp.GetMessages(2)
---
[This E-mail has been scanned for viruses but it is your responsibility
to maintain up to date anti virus software on the device that you are
currently using to read this email. ]
_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32
_______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32