Browse Source

poursuite def

master
NEVEU Thomas 4 weeks ago
parent
commit
d6c510d7ac
  1. 18
      projet_tkinter.py

18
projet_tkinter.py

@ -1,14 +1,14 @@
import tkinter as tk
#def conv () :
def convkm() :
vts1 = value.get()
value.get() = vts1/1.609
print(value.get())
def convml() :
vts2 = value.get()
print(value.get())
@ -23,14 +23,14 @@ value = tk.DoubleVar()
value.set("Entrez vitesse en Km/h ou Mph")
entree = tk.Entry(fenetre, textvariable=value, width=30)
entree.grid(column=1, columnspan= 3)
tk.Button (fenetre, text ='Kilomètres -> Miles', command = conv).grid(column=1,
tk.Button (fenetre, text ='Kilomètres -> Miles', command = convkm).grid(column=1,
row=2,
padx=5,
pady=5)
tk.Button (fenetre, text ='Miles -> Kilomètres', command = conv).grid(column=2,
tk.Button (fenetre, text ='Miles -> Kilomètres', command = convml).grid(column=2,
row=2,
padx=5,
pady=5)

Loading…
Cancel
Save