python tkinter label size code example

Example 1: set window size tkinter

# Change window_name to the name of the window object, i.e. root
window_name.geometry("500x500")
# To ensure widgets resize:
widget_name.pack(fill="both", expand=True)

Example 2: python tkinter label

from Tkinter import *

root = Tk()

w = Label(root, text="Hello Tkinter!")
w.pack()

root.mainloop()

Example 3: set label text size tkinter

label.config(font=("Courier", 44))

Example 4: tkinter label

from Tkinter import *

root = Tk()
var = StringVar()
label = Label( root, textvariable=var, relief=RAISED )

var.set("Hey!? How are you doing?")
label.pack()
root.mainloop()