[英]python error using tkinter root is not defined
I am trying to use tkinter in python.我正在尝试在 python 中使用 tkinter。
I imported tkinter using from tkinter import TK
and I defined root root = TK()
我使用
from tkinter import TK
导入了 tkinter 并定义了 root root = TK()
I use python-3 and I work on a Linux ubuntu I also did install tkinter but it keeps giving me following error:我使用 python-3 并且在 Linux ubuntu 上工作,我也确实安装了 tkinter 但它一直给我以下错误:
I am not too experienced with python yet.我对 python 还不太熟悉。 Please help me.
请帮我。
The better way is to use this one import tkinter as tk
instead of from tkinter import TK
更好的方法是使用这个
import tkinter as tk
而不是 from tkinter import TK
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.