How can I alter this code to be stand alone using Tkinter?

4104
1
01-02-2015 04:09 PM
BrendaJameson
New Contributor II

import arcpy

getShapeFile = arcpy.GetParameterAsText(0)

arcpy.Buffer_analysis(getShapeFile, bufferArea_shp, "500 Meters", "FULL", "ROUND", "ALL", "")

I am trying to use Tkinter to create an interface that will mimic the above python script. I do not know how to get the shapefile via navigating to it. I know I can use

filename = askopenfilename()

to grab a file but it is not really getting the shapefile. (may need to specify getting only file that ends in shp?)

I guess what I am really trying to figure out is how can I use an interface outside of ArcMap (i.e. a standalone script) to get the parameters I need? A pointer to some sample scripts would be helpful as well.

Thanks

Tags (3)
0 Kudos
1 Reply
XanderBakker
Esri Esteemed Contributor

Question... why do you want to build the GUI outside of ArcMap? The script will still need ArcMap to execute... If you use Tkinter to navigate to the .shp file you won't be able to use other formats like file geodatabase content.

0 Kudos