我可以从一个按钮打开一个框架。我可以关闭框架并从同一个按钮重新打开它,但每次按下按钮时都会引发错误。
在我的代码中引发错误的是root.Show()
,它给了我一个AttributeError Show
错误
我的问题是,虽然它工作得很好,但它会给我的应用程序带来严重的问题吗?
编辑:这是我的 python 文件中的代码
from Tkinter import *
root = Tk()
root.title("Help")
scrollbar = Scrollbar(root)
scrollbar.pack(side=RIGHT, fill=Y)
help_message = 'This is the help menu. Please scroll through the menu to find the answer to your question'
txt = Text(root, wrap=WORD) # wrap=CHAR, wrap=NONE
txt.pack(expand=1, fill=BOTH)
txt.insert(END, help_message)
txt.config(yscrollcommand=scrollbar.set, state=DISABLED)
scrollbar.config(command=txt.yview)
root.Show()
它从该程序的最后一行获取错误。这是命令提示符中的错误: