Python 无法在ArcMap中使用tkinter

Python 无法在ArcMap中使用tkinter,python,tkinter,arcgis,arcmap,Python,Tkinter,Arcgis,Arcmap,我正在ArcMap插件python代码中使用Tkinter。Tkinter UI打开得很好,但随后关闭或崩溃了ArcMap 我正在使用下面的代码 import arcpy import pythonaddins from Tkinter import * import tkMessageBox class ButtonClass1(object): """Implementation for Testing_addin.button (Button)""" def __init

我正在ArcMap插件python代码中使用Tkinter。Tkinter UI打开得很好,但随后关闭或崩溃了ArcMap

我正在使用下面的代码

import arcpy
import pythonaddins
from Tkinter import *
import tkMessageBox

class ButtonClass1(object):
    """Implementation for Testing_addin.button (Button)"""
    def __init__(self):
        self.enabled = True
        self.checked = False

    def onClick(self):

        root = Tk()
        lbl = Label(root, text = "Hello")
        lbl.pack()
        btn = Button(root, text = "OK")
        root.mainloop()

        pass

谢谢大家!

这回答了你的问题吗?这回答了你的问题吗?