Skip to content

Instantly share code, notes, and snippets.

@zed
Created January 25, 2018 09:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zed/4fe09d4388237b8dacee2b4b9bc6fc1b to your computer and use it in GitHub Desktop.
Save zed/4fe09d4388237b8dacee2b4b9bc6fc1b to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
"""Disable button on pressing it."""
import tkinter.ttk
root = tkinter.Tk()
button = tkinter.ttk.Button(text='Press Me Once',
command=lambda: button.state(['disabled']))
button.pack()
root.mainloop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment