Skip to content

Commit

Permalink
ajout conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas.diot committed Dec 1, 2023
1 parent dd7f102 commit 15ea399
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
41 changes: 41 additions & 0 deletions convertisseur/ui.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import tkinter as tk

fenetre = tk.Tk()

def conv(fun):
def wrapped():
nb = int(champ_saisie.get())
nb_bin = fun(nb)
label1.config(text= f"Conversion en {fun.__name__} : '{nb_bin}'")
return wrapped


fenetre.geometry("300x200")
fenetre.title("CONVERTISSEUR")
fenetre.resizable(width=False, height=False)

champ_saisie = tk.Entry(
bg= "black",
fg= "white",
bd= 5,
font='helevtica',
justify= 'center',
)
champ_saisie.place(x= 10, y= 20, width= 180)

label1 = tk.Label(fenetre, text= "test", justify= "left")
label1.place(x= 10, y= 160, width= 180)

label2 = tk.Label(fenetre, text= "Entrez un nombre décimal :")
label2.place(x= 10, y= 0, width= 180)

b1 = tk.Button(text= "Convertir en binaire", command=conv(bin))
b1.place(x= 10, y= 60, width= 180)

b2 = tk.Button(text= "Convertir en hexadecimal", command=conv(hex))
b2.place(x= 10, y= 80, width= 180)

b3 = tk.Button(text= "Caractere ASCII", command=conv(chr))
b3.place(x= 10, y= 100, width= 180)

fenetre.mainloop()
4 changes: 3 additions & 1 deletion tortue/turtle4_maison.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ def rectangle(long, larg):
rectangle(100, 80)
saut(20, 0)
rectangle(20, 40)
saut(70, 50)
saut(70, 50)
circle(10)
saut(0, 80)
goto(50, 130)
goto(100, 80)
saut(0, 0)


input()

0 comments on commit 15ea399

Please sign in to comment.