简体   繁体   English

为什么Tkinter标签使Windows python崩溃

[英]Why does Tkinter label crash the window python

Python Tkinter label cause window to say not responding when i use it more than once in 5 seconds or so. 当我在5秒钟左右使用不止一次时,Python Tkinter标签导致窗口说不响应。

Here is my code i am calling it with the variable data which is just a basic string 这是我的代码,我用变量数据来调用它,这只是一个基本字符串

def print_data(data):
    L1 = Tkinter.Label(app, text="You: " + data)
    L1.pack()

I solved the issue i was running the script externally to my main script. 我解决了在主脚本外部运行脚本的问题。 I was calling the print data script without calling mainloop(). 我在不调用mainloop()的情况下调用了打印数据脚本。 Thanks everyone :) 感谢大家 :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM