marchandd

Newbie question: script works in ArcGIS Python window but not from DOS prompt

Discussion created by marchandd on Jun 29, 2011
Latest reply on Aug 2, 2011 by sigart
OK, I give up: Here's a very simple script which, when entered line by line in the Python window within ArcGIS 10, works just fine. It reports, correctly, that the specified feature class exists. However, when the exact same file is run from the command line, on the same machine, in the same session, it reports the feature class does not exist. No Python errors are reported in either environment. The FC lives in an SDE/SQL Server environment on a remote server, has real data, makes real maps, ... Is it a permissions issue somehow? Is there something else I need to set in the environment when running it from the command line? Other?

= M =


import arcpy
from arcpy import env

env.workspace = "Database Connections/Whatever - Else"
fc = "Testenv.SDE.testFC"

if arcpy.Exists(fc):
     print "This exists: %s" % fc
else:
     print "This does not exist: %s" % fc

Outcomes