mtTkinter不会终止线程 [英] mtTkinter doesn't terminate threads

查看:400
本文介绍了mtTkinter不会终止线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用Tkinter GUI在多线程中运行一些简单的功能,因此我尝试了 mtTkinter

I need to run some simple function in multi-threading with a Tkinter GUI, so I've tried mtTkinter.

除特殊情况外,一切正常:即使我只是启动GUI,然后关闭它而又不碰任何东西,一些线程仍在运行.

Everything works fine except for a particular: even if I just start the GUI and then I close it without touching nothing some thread keeps running.

换句话说;我有以下代码:

In other words; I have this code:

from Tkinter import *
root = Tk()

#simple GUI code with buttons, labels, text and scrollbars widget
...
...    
root.mainloop()

如果我运行此代码,则会显示GUI,当我关闭它时,此python脚本将成功结束.

If I run this code the GUI appears and when I close it this python script ends successfully.

现在,如果我用mtTkinter替换Tkinter

Now if I replace Tkinter with mtTkinter

from mtTkinter import *
root = Tk()

#simple GUI code with buttons, labels, text and scrollbars widget
...
...    
root.mainloop()

GUI再次出现,但是如果我关闭它,仍然有来自mtTkinter的线程继续运行!

the GUI appears once again, but if I close it there is still some thread from mtTkinter that keeps running!

我们将不胜感激,在此先感谢您,并感谢我的英语不好!

Any help would be apprecied, thank you in advance and sorry for my bad english!

推荐答案

我已经解决"了不使用它. mTkinter似乎有点毛病.

I've "resolved" not using it. mTkinter seems to be a bit buggy.

这篇关于mtTkinter不会终止线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆