Convert Feet to Meters program in Tkinter
Last updated:24th Dec 2021
in this program, we will make a GUI desktop application of the Tkinter program for converting Feet to Meters by using Tkinter libraries of python.
from tkinter import *
def calculate():
meter=int(e1.get())/3.281
l3.config(text=str(meter))
root=Tk()
root.title("feet to meters")
l1=Label(root,text="feet")
l2=Label(root,text="is equivalent to")
l3=Label(root,text=" ")
l4=Label(root,text="meters")
e1=Entry(root)
b1=Button(root,text="Calculate",command=calculate)
l1.grid(row=0,column=2)
l2.grid(row=1,column=0)
l3.grid(row=1,column=1)
l4.grid(row=1,column=2)
e1.grid(row=0,column=1)
b1.grid(row=2,column=2)