当我运行此代码创建一个列表框并更改其外观时,我收到错误"' NoneType'对象没有属性' configure'":
listbox = Listbox(myscreen).grid(row=1, column=0, sticky=NSEW, rowspan=2)
listbox.config(border=2, relief=SUNKEN)
`
答案 0 :(得分:0)
在放置列表框之前尝试配置它。
listbox = Listbox(myscreen)
listbox.config(border=2, relief=SUNKEN)
listbox.grid(row=1, column=0, sticky=NSEW, rowsoan=2)