banniere

Le portail francophone de la géomatique


Toujours pas inscrit ? Mot de passe oublié ?
Nom d'utilisateur    Mot de passe              Toujours pas inscrit ?   Mot de passe oublié ?

Annonce

#1 Tue 25 July 2006 15:08

quimpcom
Juste Inscrit !
Date d'inscription: 17 Jul 2006
Messages: 3

pbm execution script python

Bonjour,
J'exporte un script python sous ArcCatalog. le code est  le suivant :

# ---------------------------------------------------------------------------
# qqq.py
# Created on: mar. juil. 25 2006 02:06:20
#   (generated by ArcGIS/ModelBuilder)
# ---------------------------------------------------------------------------

# Import system modules
import sys, string, os, win32com.client

print "depart"

# Create the Geoprocessor object
gp = win32com.client.dynamic.Dispatch("esriGeoprocessing.GpDispatch.1")

print "chk1"

# Load required toolboxes...
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")

print "chk2"

# Local variables...
validation = "C:\\MesDocuments\\SIG\\_TBX\\TravauxTestsPython\\GDB_RESULTAT.mdb\\validation"
validation__2_ = "C:\\MesDocuments\\SIG\\_TBX\\TravauxTestsPython\\GDB_RESULTAT.mdb\\validation"

print "chk3"

# Process: Calculer un champ...
gp.CalculateField_management(validation__2_, "compteur", "[compteur] + 1")

print "arrivee"


Lorsque je l'execute en ligne de commande, j'ai le resultat suivant avec un message d'erreur :

>>> depart
chk1
Traceback (most recent call last):
  File "C:\Python21\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript
    exec codeObject in __main__.__dict__
  File "C:\MesDocuments\SIG\_TBX\qqq.py", line 18, in ?
    gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")
  File "C:\Python21\win32com\client\dynamic.py", line 454, in __getattr__
    raise pythoncom.com_error, details
com_error: (-2147220974, 'OLE error 0x80040212', None, None)


En revanche, le script fonctionne bien sous ArcCatalog.
Si qq'un a une idée ?

Hors ligne

 

Pied de page des forums

Powered by FluxBB