from Tkinter import * imports every open object in Tkinter into the current namespace. import Tkinter imports the import Tkinter namespace into your namespace and import Tkinter as tk does the same, but renames it locally to tk to save text input
let's say we have a module foo containing classes A, B and C.
Then import foo gives you access to foo.A, foo.B and foo.C.
When you execute import foo as x , you have access to them too, but under the names xA, xB and xC from foo import * will import A, B and C directly into your current namespace so that you can access them with A, B and C.
There is also from foo import A, C , which will import A and C, but not B, into your current namespace.
You can also make from foo import B as Bar , which will make B available under the name Bar (in your current namespace).
So, usually: when you want only one module object, you do from module import object or from module import object as whatiwantittocall .
If you need some modules, you can do import module or import module as shortname to save the input.
from module import * not recommended, since you can accidentally stub ("override") names and can lose track of which objects belong to this module.
ch3ka source share