add tools
This commit is contained in:
47
tools/cuire.py
Normal file
47
tools/cuire.py
Normal file
@@ -0,0 +1,47 @@
|
||||
import tkinter as tk
|
||||
from tkinter import messagebox
|
||||
|
||||
class QuestionResponderApp:
|
||||
def __init__(self, root):
|
||||
self.root = root
|
||||
self.root.title("Question Répondeur")
|
||||
|
||||
# Configurer la taille de la fenêtre
|
||||
self.root.geometry("400x200")
|
||||
self.root.resizable(False, False)
|
||||
|
||||
# Ajout d'un titre
|
||||
self.title_label = tk.Label(
|
||||
root, text="Posez votre question", font=("Helvetica", 16), pady=10
|
||||
)
|
||||
self.title_label.pack()
|
||||
|
||||
# Champ de saisie
|
||||
self.input_box = tk.Entry(root, font=("Helvetica", 14), width=40)
|
||||
self.input_box.pack(pady=10)
|
||||
|
||||
# Bouton pour poser la question
|
||||
self.ask_button = tk.Button(
|
||||
root, text="Poser la question", font=("Helvetica", 14), command=self.respond
|
||||
)
|
||||
self.ask_button.pack(pady=10)
|
||||
|
||||
# Bouton pour quitter
|
||||
self.quit_button = tk.Button(
|
||||
root, text="Quitter", font=("Helvetica", 12), command=root.quit
|
||||
)
|
||||
self.quit_button.pack(side="bottom", pady=10)
|
||||
|
||||
def respond(self):
|
||||
question = self.input_box.get()
|
||||
if question.strip(): # Si la question n'est pas vide
|
||||
messagebox.showinfo("Réponse", "Va te faire cuire le cul.")
|
||||
else:
|
||||
messagebox.showwarning("Erreur", "Veuillez poser une question.")
|
||||
|
||||
# Lancer l'application
|
||||
if __name__ == "__main__":
|
||||
root = tk.Tk()
|
||||
app = QuestionResponderApp(root)
|
||||
root.mainloop()
|
||||
|
||||
Reference in New Issue
Block a user