Answers for "update label position in tkinter"

0

position label tkinter

import tkinter as tk  
  
# Creating the root window 
root = tk.Tk() 
  
# creating the Label with 
# the text Middle 
Label_middle = tk.Label(root,  
                        text ='Middle') 
  
# Placing the Label at  
# the middle of the root window 
# relx and rely should be properly 
# set to position the label on 
# root window 
Label_middle.place(relx = 0.5,  
                   rely = 0.5, 
                   anchor = 'center') 
  
root.mainloop()
Posted by: Guest on November-22-2020
1

label change in tkinter

stud_input=StringVar()
stud_input.set("Label")
lbl3=Label(add_image_frame,textvariable=stud_input,bg="#ED6244",fg="black").grid(row=4,column=0)
stud_input.set("Changed Label")
Posted by: Guest on October-12-2020

Python Answers by Framework

Browse Popular Code Answers by Language