From a03ce6db0dd5eb34b84324cca1b939d87afe15c4 Mon Sep 17 00:00:00 2001 From: ROBINET Julien Date: Tue, 12 May 2026 10:45:42 +0200 Subject: [PATCH 1/3] =?UTF-8?q?cr=C3=A9ation=20de=20l'ihm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- projet_tkinter_sujet5.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 projet_tkinter_sujet5.py diff --git a/projet_tkinter_sujet5.py b/projet_tkinter_sujet5.py new file mode 100644 index 0000000..c9c579e --- /dev/null +++ b/projet_tkinter_sujet5.py @@ -0,0 +1,27 @@ +import tkinter as tk +from random import randint + +def spawn_rectangle() : + """fonction pour créer un carré de taille et de couleur aléatoire""" + lst = ["red", "blue", "green", "yellow", "grey"] + indice_couleur = randint(0, len(lst)-1) + couleur = lst[indice_couleur] + taille = randint(10, 30) + position_x = randint(0, 390) + position_y = randint(0, 290) + if position_x+taille > 400 : + taille = randint(10, 400-position_x) + if position_y+taille > 300 : + taille = randint(10, 300-position_y) + rectangle = canva.create_rectangle(position_x, position_y, position_x+taille, + position_y+taille, fill = couleur) + +fenetre = tk.Tk() +fenetre.title("Carrés aléatoires") + +canva = tk.Canvas(fenetre, width = 400, height = 300, bg = "white") +canva.grid() + +Dessin = tk.Button(fenetre, text = "Dessine", command = spawn_rectangle).grid() + +fenetre.mainloop() \ No newline at end of file From a3bca6b1e4c0f52f2e51cc2560bb10e49f1ec766 Mon Sep 17 00:00:00 2001 From: ROBINET Julien Date: Tue, 12 May 2026 10:46:40 +0200 Subject: [PATCH 2/3] =?UTF-8?q?cr=C3=A9ation=20de=20l'ihm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit je me suis planter juste avant c'était pas le bon fichier --- projet_knn_feat_denis_le_goat.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/projet_knn_feat_denis_le_goat.py b/projet_knn_feat_denis_le_goat.py index e69de29..2fc0c8b 100644 --- a/projet_knn_feat_denis_le_goat.py +++ b/projet_knn_feat_denis_le_goat.py @@ -0,0 +1,16 @@ +import tkinter as tk + +fenetre = tk.Tk() +fenetre.title("pour l'instant je sais pas quoi mettre") + +canva = tk.Canvas(fenetre, width = 400, height = 300, bg = "springgreen") +canva.grid() + + + + + + + + +fenetre.mainloop \ No newline at end of file From a322c7b33f99affedc7aff4220ccd2d07128905c Mon Sep 17 00:00:00 2001 From: ROBINET Julien Date: Tue, 12 May 2026 10:48:28 +0200 Subject: [PATCH 3/3] Supprimer 'projet_tkinter_sujet5.py' --- projet_tkinter_sujet5.py | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 projet_tkinter_sujet5.py diff --git a/projet_tkinter_sujet5.py b/projet_tkinter_sujet5.py deleted file mode 100644 index c9c579e..0000000 --- a/projet_tkinter_sujet5.py +++ /dev/null @@ -1,27 +0,0 @@ -import tkinter as tk -from random import randint - -def spawn_rectangle() : - """fonction pour créer un carré de taille et de couleur aléatoire""" - lst = ["red", "blue", "green", "yellow", "grey"] - indice_couleur = randint(0, len(lst)-1) - couleur = lst[indice_couleur] - taille = randint(10, 30) - position_x = randint(0, 390) - position_y = randint(0, 290) - if position_x+taille > 400 : - taille = randint(10, 400-position_x) - if position_y+taille > 300 : - taille = randint(10, 300-position_y) - rectangle = canva.create_rectangle(position_x, position_y, position_x+taille, - position_y+taille, fill = couleur) - -fenetre = tk.Tk() -fenetre.title("Carrés aléatoires") - -canva = tk.Canvas(fenetre, width = 400, height = 300, bg = "white") -canva.grid() - -Dessin = tk.Button(fenetre, text = "Dessine", command = spawn_rectangle).grid() - -fenetre.mainloop() \ No newline at end of file