2. Importing tkinter


2.2. tkinter import everything

from tkinter import *
  • This removes the need to prefix the objects with tkinter. to access them (e.g., Button instead of tkinter.Button).

  • It makes it hard to tell what methods are from tkinter.

  • This is poor practice.


2.3. tkinter import

import tkinter
  • The tkinter. prefix is needed for tkinter objects.

  • It makes slightly longer code by using tkinter.Button compared to tk.Button