我的问题是,我有一个在tkinter中绘制的图形绘制一些地图和信息,该部分工程很好,但是当我尝试用X按钮关闭程序窗口中,进程仍在运行,我必须用stop按钮来终止进程,因为他们推荐在CMD中运行,我在windows上执行了它,并检查任务管理器,并在关闭程序后继续进行,我能做些什么来解决这个问题? 这里是剧本的结构:也许这个问题已经随着剧情做按tkinter上的退出按钮后无法完成处理
#This is some figure where i plot the maps
#marco de imagen principal
f = plt.figure(figsize=(3,3))
axe = f.add_subplot(111)
#axe = f.add_subplot(111)
#plt.axis('off')
axe.format_coord = lambda x, y: ''
#marco de ploteo de mapa
figu=plt.Figure(figsize=(2,2))
#ploteo=figu.add_subplot(111)
ploteo=figu.add_axes([0, 0, 1, 1])
ploteo.format_coord = lambda x, y: ''
plt.axis('off')
Class Inicio(tk.Tk):
def __init__(self, *args, **kwargs):
#I initialize all the menu, labels, variables and canvas and some other functions
def libro(self):
def onpress(self,event):
.
.
.
and more funtions
ex = Inicio()
ex.geometry("1280x720")
ex.mainloop()
?
我无法在Windows 7,Python 2.7上重现该问题。也许这个问题是由于你的'Inicio'班的某些事情造成的。或者它可能是一个硬件特定的错误? (http://stackoverflow.com/questions/39601107/python-tkinter-window-not-closing) – Josselin
mmm我不认为是一个具体的错误,我已经尝试在Ubuntu和Windows上,问题仍然存在。感谢无论如何:) – Ivan