1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
from tkinter import *
app = Tk()
app.title("Appli")
app.geometry("720x480")
app.minsize(720, 480)
ajout = 1
count = {}
def ajout_():
def entre():
count[x] += 1
label_source.config(text = f"{str(count[x])} %")
app.after(1000, entre)
global ajout
x = ajout
count[x] = 0
label_source = Label(app, text="count", font=("Courrier", 10), bg='#000101',
fg='white')
label_source.grid(row = x, column = 0, padx = 5, pady = 5, sticky = W)
bu_transfert = Button(app, text = "go", command = entre)
bu_transfert.grid(row = x, column = 0, padx = 450, pady = 5, sticky = W)
ajout += 1
bu = Button(app, text = "Ajout", command = ajout_).grid(row = 0, column = 0, sticky = W)
app.mainloop() |
Partager