Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. from tkinter import *
  2.  
  3. def multi():
  4. a =float(r1.get())
  5. c =float(r2.get())
  6. d = a*c
  7. print(d)
  8. t4["text"] = d
  9.  
  10. janela = Tk()
  11. janela.geometry("300x300+200+200")
  12. a =0
  13. c =0
  14.  
  15. t1 = Label(janela ,text = 'Os valores para conta de multiplicação são ?')
  16. t1.place(x=1,y=1)
  17.  
  18. r1 = Entry(janela)
  19. r1.place(x=1,y=30)
  20.  
  21. t2 = Label(janela, text = 'x')
  22. t2.place(x=124,y=30)
  23.  
  24. r2 = Entry(janela)
  25. r2.place(x=135,y=30)
  26.  
  27. bt2 = Button(janela, width=20,text = "Calcular!",command = multi)
  28. bt2.place(x=1,y=90)
  29.  
  30. t3 = Label(janela, text = "O resultado é : ")
  31. t3.place(x=1,y=55)
  32.  
  33. t4 = Label(janela, text = "?")
  34. t4.place(x=80,y=55)
  35.  
  36.  
  37.  
  38. janela.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement