[GIS] Trying to use Tkinter to open dialog box in ArcMap

arcgis-desktoparcmappythontkinter

The following script works great from the command line but crashes from the pythonaddin:

import Tkinter

import tkFileDialog
root = Tkinter.Tk()
root.withdraw()
pathtest = tkFileDialog.askopenfilename()
print pathtest

pathtest = pythonaddins.OpenDialog('Open Item', True) does not work for me because it suppresses filetypes that I need to see (pdf).

I know this is a duplicate question but I just joined the site and could not comment on other posts.

Best Answer

It is technically possible to use Tkinter in arcpy / python addins using multiprocessing, but this is quite complicated and not supported or recommended by ESRI. They recommend using C# instead of python for GUI development.

See this post and http://anothergisblog.blogspot.se/2013/07/python-add-ins-and-tkinter.html