Advertisement
Guest User

Untitled

a guest
Aug 25th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. from tkinter import Tk , ttk , messagebox
  2. root=Tk()
  3. root.title("BMI")
  4.  
  5. def buCalculate() :
  6.    buCalculate = int(Weight.get()) / int(Height.get())**2
  7.    messagebox.showinfo("Your BMI is : " , buCalculate)
  8.  
  9.  
  10. ttk.Label(root,text= "Weight :").grid(row=0,column=0)
  11. Weight=ttk.Entry(root,width=30,font=('Arial',20)).grid(row=0,column=3)
  12.  
  13. ttk.Label(root,text= "Height :").grid(row=1,column=0)
  14. Height=ttk.Entry(root,width=30,font=('Arial',20)).grid(row=1,column=3)
  15.  
  16. buCalculate = ttk.Button(root,command=buCalculate,text="Calculate").grid(row=2,column=3)
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement