INTELLIGENT ENVIRONMENT
  • Home
  • About
  • PROJECTS
  • Contact

Python

How change text in label

from tkinter import *
import time

window = Tk()
window.geometry('400x400')
var=StringVar()

msg=Label(window , textvar=var, fg = 'black', font = "times 22")
msg.pack()

def ones ():
    var.set(".................")
    msg.update_idletasks()
    time.sleep(2)
    msg.destroy()
    time.sleep(2)
    root.destroy()


def two ():
    var.set("my name is..")
    msg.update_idletasks()
    time.sleep(2)
    ones ()

def tree ():
    var.set("Hi")
    msg.update_idletasks()
    time.sleep(2)
    two ()

tree ()   

window.mainloop()



Powered by Create your own unique website with customizable templates.
  • Home
  • About
  • PROJECTS
  • Contact