When you pass command=None to the config method of the button when it is first clicked, the value isn't accepted by tkinter as it can only accept functions as values for command . Instead, do: b.config(command=lambda: None) .
command=None
command
b.config(command=lambda: None)