小编dan*_*ani的帖子

tkinter中的AttributeError

我正在尝试用tkinter编写程序.我还没有完成程序,但试图运行它只是为了看看我的窗口看起来如何,我在tkinter中得到一个错误.

我不知道现在该怎么办.谁知道错了什么?

这是消息

Traceback (most recent call last):
  File "<string>", line 420, in run_nodebug
  File "<module1>", line 53, in <module>
  File "<module1>", line 50, in main
  File "<module1>", line 23, in __init__
  File "C:\Python33\lib\tkinter\__init__.py", line 2110, in __init__
    Widget.__init__(self, master, 'button', cnf, kw)
  File "C:\Python33\lib\tkinter\__init__.py", line 2036, in __init__
    classes = [(k, v) for k, v in cnf.items() if isinstance(k, type)]
AttributeError: 'str' object has no attribute 'items'

import tkinter
import tkinter.messagebox

#---------------------- define GUI class
class CalcMPG:
    def __init__(self): …
Run Code Online (Sandbox Code Playgroud)

python tkinter

5
推荐指数
1
解决办法
2424
查看次数

标签 统计

python ×1

tkinter ×1