My python script runs well and returns all tables from mdb with arcpy.ListTables() command when i run a script in IDLE(default IDE) or python window from arcmap. But when I try to run the same script from cmd arcpy.ListTables() returns blank list . What could be the problem?And what is the solution? As I am calling this script in my C# desktop application.
arcpy.env.workspace = r"D:/Final/gdb_workspace/New Personal Geodatabase.mdb"
#Get and print a list of tables
tables = arcpy.ListTables()
for table in tables:
This is my simple code to list tables.I want to insert data from excel file to a particular table from this personal gdb.
When I run this script using cmd(out of arcgis environment) its not returning tables.
Is this possible to achieve and how? Or do I need to use any geoprocessing service?Any other way to achieve this?
I am able to insert data into mdb if i run the script in IDLE or python window from arcmap.
Please tell me the right way to do this task.
arcpy is know to exist from python within arcmap, but not outside of it. it needs to be imported in most languages (ie python running outside of arcmap, or separately from it)
probably has no effect but worth checking
r"D:/Final/gdb_workspace/New Personal Geodatabase.mdb" raw notation is used when paths have backslashes and not foreslashes
table@@ I am not farmiliar with @@ is that a substitute for printing its name?
Are you sure the script is running at all when called from the command line by your other program? If you try printing 'hello world' from the script, does that even work from the command line?