def switchButtonState(): if (button1['state'] == tk.NORMAL): button1['state'] = tk.DISABLED else: button1['state'] = tk.NORMAL