I have a model that runs a data check with an output table listing the number errors it found. I am wondering if I can complete the the model with a python statement that calls it to open the table.
I know I can just right click and open the attribute table in ArcMap, but I just thought it will be cool to have a really complete model from start to end.
I am using 10.2.2.
Thanks!
Solved! Go to Solution.
Does it need to open it in ArcMap? Depending on the format of the table, you open it to another program...
from subprocess import Popen Popen(pathToOutputTable, shell=True)
I don't believe arcpy.mapping provides this capability.
https://www.google.com/?gws_rd=ssl#q=arcpy.mapping+open+table
Thanks James, for pointing out to this module. I still have an elementary knowledge of Python usage so this is helpful.
Does it need to open it in ArcMap? Depending on the format of the table, you open it to another program...
from subprocess import Popen Popen(pathToOutputTable, shell=True)
Great, it works!
Thanks Bill.
This opens an attribute table in ArcGIS?
Not in arcmap...but you can open arcmap...soooo if you coincidently had a project with a table open AND you ran that it would open the project that you direct it to. You can open any-ish file IF it has a pre-designated file association...you don't need to know the path to the *.exe. Give it a whirl...limited use and be careful on how you use it with reading the documentation at the python site
What I did was to changed my model to output as a shapefile instead of a feature class, and then use that function to open the .dbf table in Excel.
I read your OP that you were asking how to open an attribute table in ArcGIS but I can see how you simply used that as an example ("right-click to open the table in ArcMap").
There are a number of options. One is to convert your table to a numpy array with arcpy.da.TableToNumPyArray() and then save the numpy array to a .csv file. I'd prefer this option over working with .dbf's. Then issue Bills approach to open that file directly.
I usually work with csv's as well. No reason to create a shape file if you don't need to.