我正在Wing中运行我的程序,它会返回更改错误消息。在运行时我得到诸如未知选项之类的消息; -screen,-use,-class和所有未出现在代码中的东西
from tkinter import*
class Trip:
def __init__(self, parent):
self.rating_frame = Frame(parent, width = 350, height = 320, bg = "chartreuse")
self.rating_frame.grid_propagate(0) # to reserve space required for frame
self.summary_frame = Frame(parent, width = 350, height = 320, bg = "orchid")
self.summary_frame.grid_propagate(0)
self.Pname = Label(self.rating_frame, parent, text = "Name:")
self.Pname.grid(row = 0, column = 0, sticky = E)
self.E_name = Entry(self.rating_frame, parent, width = 20)
self.E_name.grid(row = 0, column = 1, sticky = W)
self.names.append(E_name)
self.menuButton = Button(self.rating_frame, parent, text = "Continue", command = self.cleardata)
self.menuButton.grid(row = 7, column = 1)
def cleardata(self):
self.rating_frame.grid_remove()
root.update_idletasks() # Necessary on some operating systems to force the screen to refresh properly
#main routine
if __name__ == "__main__":
root = Tk()
root.title("Traveller Details")
test = Trip(root)
root.geometry("450x350+0+0")
root.mainloop()
答案 0 :(得分:0)
问题在于这一行:
const exceptionsCharClass = exceptions
.map(char => char.replace(/[\.\-\]\[]/, '\\$1')) // escape . - [ and ]
.join(''); // join
const exceptionsPattern = `[${exceptionCharClass}]`
// exceptionsPattern is now [t\.\-], which you can use to replace once instead of in a loop.
需要移除self.Pname = Label(self.rating_frame, parent, text = "Name:")
或self.rating_frame
。我的猜测是你需要删除parent
,假设你希望这个标签在评级框架内。