Entry
What is the difference between 'import Tkinter' and 'from Tkinter import *'?
Jul 29th, 2000 20:21
unknown unknown, richard_chamberlain
If you use the from <something> import <something or *> it imports the
contents into the current namespace.
For instance if you use:
from Tkinter import *
you can use Label or Button directly,
However, if you use import Tkinter you would have to use Tkinter.Label
or Tkinter.Button.
It is considered fairly poor practice to use from * import because
you're bringing everything into the current namespace. One of the
exceptions to this is GUI programming (i.e. Tkinter or whatever)
because the names used are fairly obviously GUI related
(Button,Widget,Canvas,etc.)