RDE 发表于 2019-4-17 23:42:33

tkinter模块使用故障AttributeError: module 'tkinter' has no attribute 'Tk

新手刚学到tkinter模块,按照小甲鱼的代码一模一样敲进去,结果就报下面错误,去百度了一下,大概原因是:python工程文件命名与tkinter一样,导致你引入函数实际上是引入自己。问题是要怎么解决这个问题,找了一晚上也没有个结果,求大神帮忙

Traceback (most recent call last):
File "C:\Users\AMD\Desktop\程序\ek.py", line 3, in <module>
    app=tk.TK()
AttributeError: module 'tkinter' has no attribute 'TK'


cwhsmile 发表于 2019-4-17 23:46:06

大写T小写k

app=tk.Tk()

RDE 发表于 2019-4-17 23:49:43

本帖最后由 RDE 于 2019-4-17 23:51 编辑

cwhsmile 发表于 2019-4-17 23:46
大写T小写k

app=tk.Tk()

可以了,谢谢老铁
页: [1]
查看完整版本: tkinter模块使用故障AttributeError: module 'tkinter' has no attribute 'Tk