Importing tkinter
doesn't import some basic and useful modules such as messagebox
, as explained here: tkinter.messagebox.showinfo doesn't always work
How do I check which modules are actually imported with import tkinter
and which ones can be potentially imported by importing them explicitly (e.g. from tkinter import messagebox
)?
Use this code example to check all that is imported with tkinter:
You will get a large amount of data printed to the console that shows all the imports and "constants" that are imported with
*
.If you take the time to read the tkinter documentation you will see a section that says the following:
This section contains all the other commonly needed imports that do not get imported with
*
. One that does not seam to be listed in this section that I believe should be isttk
. Thettk
imports are also separate from*
.For
ttk
imports you can use fancy looking buttons and other widgets that all use a common style that can be set in the code as well. It is visually nice to use but not 100% needed in the work that is done in the GUI.