Python:虚拟键盘按钮未显示

Python:虚拟键盘按钮未显示,python,user-interface,python-3.x,Python,User Interface,Python 3.x,我正在尝试使用python 3.5制作一个屏幕键盘。但是,当我尝试运行程序时,只有空格按钮出现,其余的按钮没有出现 buttons = [ 'q','w','e','r','t','y','u','i','o','p','<-','7','8','9','-', 'a','s','d','f','g','h','j','k','l','[',']','4','5','6','+', 'z','x','c','v','b','n','m',',','.','?','&','1','2

我正在尝试使用python 3.5制作一个屏幕键盘。但是,当我尝试运行程序时,只有空格按钮出现,其余的按钮没有出现

buttons = [
'q','w','e','r','t','y','u','i','o','p','<-','7','8','9','-',
'a','s','d','f','g','h','j','k','l','[',']','4','5','6','+',
'z','x','c','v','b','n','m',',','.','?','&','1','2','3','/',
'SPACE',
]
label1 = Label(Keyboard_App,text=("\n")).grid(row = 0,columnspan = 1)
entry = Entry(Keyboard_App, width = 128)
entry.grid(row = 1, columnspan = 15)

varRow = 2
varColumn = 0

for button in buttons:

command = lambda x = button: select(x)
if button != "Space":
    tkinter.Button(Keyboard_App, text = button, width = 5,bg = "#000000",fg = "#ffffff",
    activebackground = "#ffffff", activeforeground = "#000000", relief = 'raised',padx = 4,
    pady = 4, bd = 4, command = command).grid(row = varRow, column = varColumn)

if button == "Space":
    tkinter.Button(Keyboard_App, text = button, width = 60, bg = "#000000",fg = "#ffffff",
    activebackground = "#ffffff", activeforeground = "#000000", relief = 'raised',
    padx = 4, pady = 4, bd = 4, command = command).grid(row = 6, columnspan = 16)
按钮=[

‘q’、‘w’、‘e’、‘r’、‘t’、‘y’、‘u’、‘i’、‘o’、‘p’、‘那你的问题是什么?;-)顺便说一句,for循环中的按钮永远不会是“空格”。所以第二个if将永远不会被执行。(“空格”!=“空格”)@palsch我已经解决了键盘的问题。谢谢