Traceback (most recent call last):
File “F:/py/recognition.py”, line 32, in
checkbuttonInclude = tkinter.Checkbutton(root,varibale=include_pinyin,
File “E:\Anaconda3.8\Anaconda3.8_destination_fold\lib\tkinter_init_.py”, line 2993, in init
Widget.init(self, master, ‘checkbutton’, cnf, kw)
File “E:\Anaconda3.8\Anaconda3.8_destination_fold\lib\tkinter_init_.py”, line 2567, in init
self.tk.call(
_tkinter.TclError: unknown option “-varibale”
"varibale"改成“variable”
Exception in Tkinter callback
Traceback (most recent call last):
File “E:\Anaconda3.8\Anaconda3.8_destination_fold\lib\tkinter_init_.py”, line 1883, in call
return self.func(*args)
File “F:/py/recognition.py”, line 50, in search
tkinter.messagebox.showinfo(‘提示’, ‘只能查单个字的读音’)
AttributeError: module ‘tkinter’ has no attribute ‘messagebox’
引入所需要的模块
import tkinter.messagebox
只要你思路没啥毛病,出现的错误可能需要你好好仔细地检查。其实好多毛病差不多一样,多总结就会减少bug.