我在Python中收到Tkinter的奇怪错误

我在Python中收到Tkinter的奇怪错误,python,tkinter,Python,Tkinter,我正在尝试创建tkinter项目,但当我第三次尝试运行时,出现以下错误: Traceback (most recent call last): File "/Users/cool/Documents/STM Wisepay Service.py", line 63, in <module> app = App(root) File "/Users/cool/Documents/STM Wisepay Service.py", line 20, in __init__ sel

我正在尝试创建tkinter项目,但当我第三次尝试运行时,出现以下错误:

Traceback (most recent call last):
File "/Users/cool/Documents/STM Wisepay Service.py", line 63, in <module> 
  app = App(root)
File "/Users/cool/Documents/STM Wisepay Service.py", line 20, in __init__
  self.create_buttons()  
File "/Users/cool/Documents/STM Wisepay Service.py", line 30, in create_buttons
  tk.Button(button_frame, text = "Add to Debt", commmand = self.debt).grid(column = 6, row = 5)  
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py", line 2366, in __init__
  Widget.__init__(self, master, 'button', cnf, kw  
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py", line 2296, in __init__
  (widgetName, self._w) + extra + self._options(cnf)
_tkinter.TclError: unknown option "-commmand"
回溯(最近一次呼叫最后一次):
文件“/Users/cool/Documents/STM Wisepay Service.py”,第63行,在
app=app(根目录)
文件“/Users/cool/Documents/STM Wisepay Service.py”,第20行,在__
self.create_按钮()
文件“/Users/cool/Documents/STM Wisepay Service.py”,第30行,在创建按钮中
按钮(按钮框架,text=“添加到债务”,commmand=self.Debt).grid(列=6,行=5)
文件“/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/_init__.py”,第2366行,在_init中__
小部件。_uu初始化(自,主,“按钮”,cnf,kw
文件“/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/_init__.py”,第2296行,在_init中__
(widgetName,self._w)+额外+自选项(cnf)
_tkinter.TclError:未知选项“-commmand”
我能做些什么来解决这个问题?我的代码有什么问题

这是我的密码:

您拼写命令错误(三个m)

您正在向它传递一个名为
commmand
的变量,而它不知道如何使用该变量

tk.Button(... commmand = ...
您可以在这里的错误消息中看到它

_tkinter.TclError: unknown option "-commmand"

这些python错误消息实际上非常有用。我鼓励您仔细阅读它们,以了解类似的内容。

请不要链接到其他网站上的代码。花时间创建一个链接,并将其直接包含在问题中。您的代码似乎没有定义什么是
self.debt
。请仔细阅读错误消息。R读取每个字符。请复制并粘贴回溯,而不进行添加空行和删除代码行缩进的编辑。粘贴后,选择整个块并单击{}符号将其缩进为代码。@TerryJanReedy这对代码没有任何影响。这只是一个简单的样式首选项。我知道PEP8样式指南显示在那里不使用空格,但这并不有害。