I've browsed the similarly phrased questions, but haven't found an answer:
When importing SOME libraries, it seems like I have to import the top level library in one statement, and then import the module or object I want to use in a second statement. An example that I have recently come across is:
import tkinter as tk
import tkinter.filedialog
Which results in me being able to get a file dialog in two different ways:
files = filedialog.askopenfilenames()
or
files = tk.filedialog.askopenfilenames()
Why can I not call the second option without importing tkinter.filedialog
? I'm not familiar with the specific structure of files/packages/modules/ etc. I assume it has something to do with it.