On this page
tkinter.Button
Up: tkinter | Next: tkinter.Canvas
Rel: tkinter.Canvas, tkinter.Entry, tkinter.Frame, tkinter.Label
Ref: docs.python.org — tkinter.Button
Tags: #public #python3 #stdlib #tkinter
Import
import tkinter
from tkinter import Button
Signature & Overview
tkinter.class Button(master=None, cnf={}, **kw)
Button widget to trigger a callback command.
Usage
import tkinter as tk
# Inside a GUI app: tk.Button(root, text='Run', command=on_click).pack()
assert hasattr(tk, 'Button')
Gotchas
- Requires a GUI display: Pass
command=fn(a callable, NOTfn()which runs immediately).
REPL Inspect
from tkinter import Button
help(Button)
Linked from
Related notes
- tuts/python3/stdlib_module/tkinter/Canvas Linked here; links to this page; shared tags: #stdlib, #tkinter
- tuts/python3/stdlib_module/tkinter/Entry Linked here; links to this page; shared tags: #stdlib, #tkinter
- tuts/python3/stdlib_module/tkinter/Frame Linked here; links to this page; shared tags: #stdlib, #tkinter
- tuts/python3/stdlib_module/tkinter/Label Linked here; links to this page; shared tags: #stdlib, #tkinter
- tuts/python3/stdlib_module/tkinter Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/tkinter/Tk links to this page; shared tags: #stdlib, #tkinter
- tuts/python3/tutorials/popular_application_domains/desktop_gui_development shared tags: #stdlib, #tkinter
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib