SHARE
TWEET

Untitled

a guest Aug 25th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top