Skip to content

Instantly share code, notes, and snippets.

@EbrahimGhanbari
Created September 6, 2020 19:09
Show Gist options
  • Save EbrahimGhanbari/529ed870508395b4df25be426c73e31c to your computer and use it in GitHub Desktop.
Save EbrahimGhanbari/529ed870508395b4df25be426c73e31c to your computer and use it in GitHub Desktop.
udemy_python_tkinter_kmToMile_App
from tkinter import *
window=Tk()
def kmToMiles():
miles = float(e1_value.get())*(1/1.6)
t1.insert(END, miles)
b1=Button(window, text="Execute", command=kmToMiles)
b1.grid(row=0, column=0)
e1_value=StringVar()
e1=Entry(window, textvariable=e1_value)
e1.grid(row=0, column=1)
t1=Text(window, height=1, width=20)
t1.grid(row=0, column=2)
window.mainloop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment