Skip to content

paiement enseignant  #26

@daicielkibula

Description

@daicielkibula

============================================================

APPLICATION SIMPLE DE PAIEMENT DES ENSEIGNANTS

Langage : Python

Auteur : ChatGPT

============================================================

import tkinter as tk
from tkinter import messagebox
from datetime import datetime

-------------------------

Fonction de calcul

-------------------------

def calculer_paiement():
try:
nom = entry_nom.get()
heures = float(entry_heures.get())
taux = float(entry_taux.get())

    salaire = heures * taux
    date = datetime.now().strftime("%d/%m/%Y")

    resultat.set(
        f"----- FICHE DE PAIEMENT -----\n"
        f"Nom : {nom}\n"
        f"Heures prestées : {heures}\n"
        f"Taux horaire : {taux} $\n"
        f"Salaire total : {salaire} $\n"
        f"Date : {date}"
    )

except ValueError:
    messagebox.showerror(
        "Erreur",
        "Veuillez entrer des valeurs correctes."
    )

-------------------------

Fenêtre principale

-------------------------

fenetre = tk.Tk()
fenetre.title("Paiement des Enseignants")
fenetre.geometry("500x400")
fenetre.config(bg="#dfefff")

-------------------------

Titre

-------------------------

titre = tk.Label(
fenetre,
text="APPLICATION DE PAIEMENT",
font=("Arial", 18, "bold"),
bg="#dfefff",
fg="#003366"
)
titre.pack(pady=10)

-------------------------

Nom enseignant

-------------------------

label_nom = tk.Label(
fenetre,
text="Nom de l'enseignant",
bg="#dfefff"
)
label_nom.pack()

entry_nom = tk.Entry(fenetre, width=40)
entry_nom.pack(pady=5)

-------------------------

Heures

-------------------------

label_heures = tk.Label(
fenetre,
text="Nombre d'heures",
bg="#dfefff"
)
label_heures.pack()

entry_heures = tk.Entry(fenetre, width=40)
entry_heures.pack(pady=5)

-------------------------

Taux horaire

-------------------------

label_taux = tk.Label(
fenetre,
text="Taux horaire ($)",
bg="#dfefff"
)
label_taux.pack()

entry_taux = tk.Entry(fenetre, width=40)
entry_taux.pack(pady=5)

-------------------------

Bouton calcul

-------------------------

btn = tk.Button(
fenetre,
text="Calculer Paiement",
command=calculer_paiement,
bg="#0066cc",
fg="white",
font=("Arial", 12, "bold")
)
btn.pack(pady=15)

-------------------------

Résultat

-------------------------

resultat = tk.StringVar()

zone_resultat = tk.Label(
fenetre,
textvariable=resultat,
justify="left",
bg="white",
width=50,
height=10,
anchor="nw",
relief="solid",
padx=10,
pady=10
)
zone_resultat.pack(pady=10)

-------------------------

Lancement

-------------------------

fenetre.mainloop()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions