This section is not just true about Tkinter, but for any Python object for which you need help.
Let's say you need a reference on Tkinter Pack geometry manager, you can get interactive help in your Python interactive shell using the help command, as shown in the following command lines:
>>> import Tkinter >>> help(Tkinter.Pack)
This provides a detailed help documentation on all the methods defined under the Pack
class in Tkinter.
You can similarly view help for all other individual widgets. For instance, you can check comprehensive and authoritative help documentation for Label widget in the interactive shell by typing:
>>>help(Tkinter.Label)
This provides a list of:
Label
Finally, when in doubt about a method, look into the source file located at <location-of-python-installation>liblib-tkTkinter.py
.
The lib-tk
directory is the home to some great Tkinter code that you can study. In particular, you may also want to take a look at the source code of:
You might also find it useful to look at the source code implementation of various other modules, such as the color chooser, file dialogs, ttk module, and others.
18.189.170.134