Modern Tkinter ebook If you've found the material on this site useful, please consider purchasing this e-book (only $10), which is based on the Python material in the tutorial. Doing so helps me maintain and update this site. Thank you very much!



Kindle Buy now for your Kindle
Kindle apps are also available for most smartphones, tablets, and desktops. Payment and download handled by Amazon's Kindle Store.


PDF Buy the DRM-free PDF
Downloads handled by Payment handled via Stripe (credit cards) or PayPal.

The widget roundup provides you with a quick and easy reference to the most important features and options for each Tk widget.


Widget Essentials

When to use: To show a static text or image to the user, whether identifying some other user interface element (e.g. "Name" next to an entry), something purely decorative, or presenting a result. Users normally do not interact with labels.
Tcl usage: ttk::label .lbl -text "Name:"
Ruby usage: {text "Name:"}
Reference: (at

Common Options

text The text string to be shown in the label.
textvariable As an alternative to text, get the string from a variable, updating when the variable changes.
Specify a Tk Image object (not the path to an image file) instead of the text string. If compound is center, top, bottom, left, or right, display the text and the image.
justify Alignment of text: left, center or right.
wraplength For multi-line labels; let Tk calculate the line breaks rather than explicitly embedding newlines in the text string.