我遇到了一个小麻烦,恐怕在python3和tkinter中,答案很容易想到。在
所以我在做这个屏幕键盘,我想在我按下“enterCountryBtn”时启用它,但是它只启用kybrd_列表中的一个按钮/“key”。在
问题很简单;当我按下“enterCountryBtn”时,如何确保启用完整列表?在
我的问题似乎出现在代码的这一部分:
def countryCommand():
keyboardButtons['state']=tk.NORMAL
print("country")
kybrd_list = [
'q','w','e','r','t','y','...']
ro = 2
co = 0
for k in kybrd_list:
*A bunch of stuff goes here*
keyboardButtons=tk.Button(root, text=k, width=5, relief=rel2, command=cmd2, state=tk.DISABLED
*and some more stuff here*
enterCountryBtn = tk.Button(root, width=30, text="enter Country", command=countryCommand)
enterCountryBtn.grid(row=7, column=0)
提前谢谢你, 尼尔斯
列出
keyboardButtons
一个列表:下面是一个可运行的示例:
^{pr2}$相关问题 更多 >
编程相关推荐