Search code examples
pythonpython-3.xtkinterttk

what is the difference between Label and ttk.Label in tkinter


I have a code but After add just Label frame not working fine like that :

label = Label(self, text="Test-1")
label .grid(row=1, stick="w", padx=20)

The Label not go in Left.

but after add ttk :

label = ttk.Label(self, text="Test-1")
label .grid(row=1, stick="w", padx=20)

the Label Frame work fine why?


Solution

  • Because in the first one you didn't use this phrase

    from tkinter import *
    

    The * imports everything related to tkinter but if you used this

    from tkinter import ttk
    

    you only import the function that create the table only