Advertisement
Guest User

Teste

a guest
Jul 17th, 2015
230
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from tkinter import *
  2.  
  3. #Configurações da Tela
  4. window = Tk()
  5. window.title("Hello World")  
  6. window.resizable(width=False, height=False)
  7. window.geometry("300x300")
  8.  
  9. TextoLabel = StringVar()
  10. TextoLabel.set("AAAAAA")
  11. #Criando uma funcao para dar update na Label
  12.  
  13.  
  14. #Widgets
  15. entrada = Entry(window)
  16. lbl = Label(textvariable = TextoLabel)
  17. b = Button(text="see ya?!")
  18.  
  19.  
  20.  
  21.  
  22. #Mostrar todos os itens na tela
  23.  
  24. b.pack()
  25. entrada.pack()
  26. lbl.pack()
  27. window.mainloop()
  28.  
  29.  
  30.  
  31.  
  32.  
  33. while True:
  34.     if entryname.get() == "":
  35.         lbl.config(text = "Nada")
  36.         window.update_idletasks()
  37.     else:
  38.         lbl.config(text = entryname.get())
  39.         window.update_idletasks()
Advertisement
RAW Paste Data Copied
Advertisement