Terry J. Reedy <tjre...@udel.edu> added the comment:
The specific subsection link is https://docs.python.org/3/library/tkinter.html#setting-options The outputs >>> import tkinter as tk >>> r = tk.Tk() >>> r.config('bg') ('background', 'background', 'Background', <string object: 'SystemButtonFace'>, 'SystemButtonFace') >>> r.config()['bg'] ('bg', '-background') I think "Example: >>> print(fred.config()) {'relief': ('relief', 'relief', 'Relief', 'raised', 'groove')} Of course, the dictionary printed will include all the options available and their values. This is meant only as an example." would be clearer with ellipses instead of the sentence after a misleading output. "Example key-value pair in the dictionary returned by config(): >>> fred.config() {..., 'relief': ('relief', 'relief', 'Relief', 'raised', 'groove'), ...}" The previous code should set the relieve to 'groove' in order for this to make more sense. Or, instead use example with 2- and 5-tuples. {..., 'fg': ('fg', '-foreground'), ..., 'foreground': ('foreground', 'foreground', 'Foreground', 'SystemButtonText', 'SystemButtonText'), ...} --- Side note: the third members of these tuples are reversed. Bug in tk? b.config('activebackground') ('activebackground', 'activeBackground', 'Foreground', 'SystemButtonFace', 'SystemButtonFace') b.config('activeforeground') ('activeforeground', 'activeForeground', 'Background', 'SystemButtonText', 'SystemButtonText') ---------- assignee: -> docs@python components: +Documentation nosy: +docs@python, serhiy.storchaka, terry.reedy stage: -> needs patch versions: +Python 3.11 -Python 3.6, Python 3.9 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44481> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com