当前位置: 首页 > 工具软件 > pinyin.py > 使用案例 >

“E:\Anaconda3.8\Anaconda3.8_destination_fold\lib\tkinter_init_.py”, line 2567, in init self.tk.call(

段干瑞
2023-12-01

遇到的问题1

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

遇到的问题2

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.

 类似资料: