Tkinter Widget Dimensions
-
height sets the height of the widget control (in this case, the label) in characters.
-
width sets the width of the widget control (in this case, the label) in characters.
Example
Set the label width to 15, height to 15, background to yellow and foreground to red.
from tkinter import *
root = Tk()
root.title("apidemos.com")
label = Label(root,text="I like tkinter",
fg="red",bg="yellow",
height=15,width=15)
label.pack() # Packaging and positioning components
# print(type(label)) # <class 'NoneType'>
root.mainloop()
Output: