【发布时间】:2017-02-21 11:08:23
【问题描述】:
我在一个大程序中有以下几行。
username = Entry(loginPage)
password = Entry(loginPage)
button1 = Button(loginPage,text = "Login", fg = "red", command = loginClicked(username.get(),password.get()))
程序运行时,函数loginClicked在开始时运行一次(当字段为空且未单击按钮时),这是它运行的唯一时间。之后,当单击按钮时,该功能根本不会运行。函数中的打印语句证实了这一点。
【问题讨论】:
标签: python user-interface button login tkinter