33# Youtube: https://www.youtube.com/c/MagnoEfren
44
55from tkinter import Canvas , Button , Frame , Label ,Tk
6-
76ventana = Tk ()
87ventana .config (bg = 'black' )
98ventana .geometry ('500x250' )
3837frame5 .columnconfigure (0 , weight = 1 )
3938frame5 .rowconfigure (0 , weight = 1 )
4039
41-
4240canvas1 = Canvas (frame1 , bg = 'gray40' , width = 200 , height = 200 ,highlightthickness = 0 )
4341canvas1 .grid (column = 0 ,row = 0 , sticky = 'nsew' )
4442canvas2 = Canvas (frame2 , bg = 'gray30' , width = 200 , height = 200 ,highlightthickness = 0 )
4543canvas2 .grid (column = 0 ,row = 0 , sticky = 'nsew' )
4644canvas3 = Canvas (frame3 , bg = 'gray20' , width = 200 , height = 200 ,highlightthickness = 0 )
4745canvas3 .grid (column = 0 ,row = 0 , sticky = 'nsew' )
4846
49-
5047texto1 = canvas1 .create_text (1 ,1 , text = '0' , font = ('Arial' ,12 ,'bold' ), fill = 'White' )
5148texto2 = canvas2 .create_text (1 ,1 , text = '0' , font = ('Arial' ,12 ,'bold' ), fill = 'White' )
5249texto3 = canvas3 .create_text (1 ,1 , text = '0' , font = ('Arial' ,12 ,'bold' ), fill = 'White' )
6966click_lectura = 0
7067clik_stop = 0
7168clik_inicio = 0
72-
7369def iniciar_pausar ():
7470 global mi , se , ml , contar , clik_stop , clik_inicio
7571 ml = ml + 1
@@ -84,15 +80,13 @@ def iniciar_pausar():
8480 if clik_inicio is None :
8581 stop .grid (column = 0 , row = 0 , padx = 10 , pady = 10 , sticky = 'nsew' )
8682 stop .config (bg = 'orange' , text = 'DETENER' )
87-
8883def stop_boton ():
8984 global contar , clik_stop
9085 clik_stop = stop .grid_forget ()
9186 if clik_stop is None :
9287 inicio .grid (column = 0 , row = 0 , padx = 10 , pady = 10 , sticky = 'nsew' )
9388 inicio .config (bg = 'aqua' , text = 'CONTINUAR' )
9489 inicio .after_cancel (contar )
95-
9690def vueltas ():
9791 global mi , se , ml ,click_lectura
9892
@@ -116,7 +110,6 @@ def vueltas():
116110 lectura6 .config (text = '{} → {}:{}:{}' .format (click_lectura , mi ,se ,ml ),
117111 fg = 'white' , bg = 'gray10' )
118112 click_lectura = 0
119-
120113def reiniciar ():
121114 global mi , se , ml , contar , click_lectura
122115 mi = 0
@@ -133,7 +126,6 @@ def reiniciar():
133126 stop .grid_forget ()
134127 inicio .grid (column = 0 , row = 0 , padx = 10 , pady = 10 , sticky = 'nsew' )
135128 inicio .config (bg = 'green2' , text = 'INICIAR' )
136-
137129def coordenadas ():
138130 x = canvas1 .winfo_width ()
139131 y = canvas1 .winfo_height ()
0 commit comments