我能夠從一個按鈕打開框架。我可以關閉框架並從同一個按鈕重新打開它,但每次按下按鈕時都會報錯。打開和關閉一個框架
什麼是引發錯誤在我的代碼是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()
正是從這個程序的最後一行採取錯誤的代碼。這是在命令提示符處錯誤:
您能否同時顯示您的代碼和'AttributeError'全文? –
您能否發佈您的應用程序的相關部分,您是否也可以告訴我們您使用的是什麼框架......可能是Tkinter? – John