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
| from tkinter import *
import time
#main
fenetre_jeu = Tk()
fenetre_jeu.wm_state(newstate="zoomed")
fenetre_jeu.title("Lesson sympa")
fenetre_jeu['bg'] = "light sky blue"
##########################################################
def jeu_lance():
liste_chrono = ['3', '2', '1']
for x in range(3):
label_compteur.config(text = liste_chrono[x])
time.sleep(1)
def lancement_page():
bouton_play.pack_forget()
# label_nombre_aleatoire
label_nombre_aleatoire = Label(frame_central, bg = 'yellow', fg = 'blue', font = ('Impact', 20), width = 20, justify = CENTER)
label_nombre_aleatoire.grid(row = 0, column = 1)
#label compteur
global label_compteur
label_compteur = Label(frame_central, bg = "light sky blue", fg = 'red', font = ('Impact', 20), text = "3", width = 2)
label_compteur.grid(row = 0, column = 2)
#label placement
label_placement = Label(frame_central, bg = "light sky blue", font = ('Impact', 20), width = 2)
label_placement.grid(row = 0, column = 0)
jeu_lance()
###########################################################
# frame central
global frame_central
frame_central = Frame(fenetre_jeu, borderwidth = 1, bg="light sky blue")
frame_central.pack(expand = YES)
#bouton play
global bouton_play
bouton_play = Button(frame_central, bg = 'red', fg = 'blue', font = ('Arial', 20), text = 'PLAY', command = lancement_page)
bouton_play.pack() |
Partager