Skip to content

Commit 02c5200

Browse files
authored
Update cronometro.py
1 parent fc22b3f commit 02c5200

File tree

1 file changed

+2
-58
lines changed

1 file changed

+2
-58
lines changed

Cronometro/cronometro.py

Lines changed: 2 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,12 @@
4242
frame4.rowconfigure(0, weight=1)
4343
frame5.columnconfigure(0, weight=1)
4444
frame5.rowconfigure(0, weight=1)
45-
4645
canvas1= Canvas(frame1, bg='gray40', width=200, height =200,highlightthickness=0)
4746
canvas1.grid(column=0,row=0, sticky='nsew')
4847
canvas2= Canvas(frame2, bg='gray30', width=200, height =200,highlightthickness=0)
4948
canvas2.grid(column=0,row=0, sticky='nsew')
5049
canvas3= Canvas(frame3, bg='gray20', width=200, height =200,highlightthickness=0)
5150
canvas3.grid(column=0,row=0, sticky='nsew')
52-
5351
texto1 = canvas1.create_text(1,1, text='0', font=('Arial',12,'bold'), fill= 'White')
5452
texto2 = canvas2.create_text(1,1, text='0', font=('Arial',12,'bold'), fill= 'White')
5553
texto3 = canvas3.create_text(1,1, text='0', font=('Arial',12,'bold'), fill= 'White')
@@ -82,27 +80,20 @@ def iniciar_pausar():
8280
if se ==59:
8381
se = 0
8482
mi = mi + 1
85-
8683
contar = inicio.after(1, iniciar_pausar)
87-
88-
clik_inicio = inicio.grid_forget()
89-
84+
clik_inicio = inicio.grid_forget()
9085
if clik_inicio is None:
9186
stop.grid(column=0, row=0, padx =10, pady=10, sticky='nsew')
9287
stop.config(bg= 'orange', text= 'DETENER')
9388

94-
9589
def stop_boton():
9690
global contar, clik_stop
97-
98-
9991
clik_stop = stop.grid_forget()
10092
if clik_stop is None :
10193
inicio.grid(column=0, row=0, padx =10, pady=10, sticky='nsew')
10294
inicio.config(bg= 'aqua', text='CONTINUAR')
10395
inicio.after_cancel(contar)
10496

105-
10697
def vueltas():
10798
global mi, se, ml,click_lectura
10899

@@ -127,9 +118,6 @@ def vueltas():
127118
fg = 'white', bg='gray10')
128119
click_lectura = 0
129120

130-
131-
132-
133121
def reiniciar():
134122
global mi, se, ml, contar, click_lectura
135123
mi = 0
@@ -143,7 +131,6 @@ def reiniciar():
143131
lectura4.configure(text='Lectura 4', fg = 'white', bg='gray10')
144132
lectura5.configure(text='Lectura 5', fg = 'white', bg='gray10')
145133
lectura6.configure(text='Lectura 6', fg = 'white', bg='gray10')
146-
147134
stop.grid_forget()
148135
inicio.grid(column=0, row=0, padx =10, pady=10, sticky='nsew')
149136
inicio.config(bg= 'green2', text='INICIAR')
@@ -157,39 +144,30 @@ def coordenadas():
157144
y1 = int(y - 0.1*x - 0.1*y + 20)
158145
x2 = int(x - 0.4*x - 0.4*y - 15)
159146
y2 = int(y - 0.4*x - 0.4*y - 30)
160-
161147
tamano = int( y1*0.2 + x1*0.1 + 10 )
162148
tamano_texto = int( y1*0.02 + x1*0.02 + 3 )
163-
164149
#print(x1, y1, x2, y2)
165150
canvas1.coords(circulo1, x1,y1,x2,y2)
166151
canvas2.coords(circulo2, x1,y1,x2,y2)
167152
canvas3.coords(circulo3, x1,y1,x2,y2)
168-
169153
#cordenas numeros
170154
z1 = int(x1*0.6- 10)
171155
z2 = int(y1*0.6 - 10)
172-
173156
#coordenadas texto
174157
w1 = int(x1*0.49 + 8)
175158
w2 = int(y1*0.8 + 10)
176-
177159
canvas1.coords(texto1, z1, z2)
178160
canvas2.coords(texto2, z1, z2)
179161
canvas3.coords(texto3, z1, z2)
180-
181162
canvas1.itemconfig(texto1, font=('Arial',tamano,'bold'),text= mi)
182163
canvas2.itemconfig(texto2, font=('Arial',tamano,'bold'),text= se )
183164
canvas3.itemconfig(texto2, font=('Arial',tamano,'bold'), text= ml)
184-
185165
canvas1.coords(texto_minutos, w1, w2)
186166
canvas2.coords(texto_segundos, w1, w2)
187167
canvas3.coords(texto_milisegundos, w1, w2)
188-
189168
canvas1.itemconfig(texto_minutos, font=('Arial',tamano_texto,'bold'))
190169
canvas2.itemconfig(texto_segundos, font=('Arial',tamano_texto,'bold'))
191-
canvas3.itemconfig(texto_milisegundos, font=('Arial',tamano_texto,'bold'))
192-
170+
canvas3.itemconfig(texto_milisegundos, font=('Arial',tamano_texto,'bold'))
193171
canvas1.after(1000, coordenadas)
194172

195173
frame4.columnconfigure(0, weight= 1)
@@ -205,7 +183,6 @@ def coordenadas():
205183
frame4.columnconfigure(5, weight= 1)
206184
frame4.rowconfigure(0, weight= 1)
207185

208-
209186
lectura1 = Label(frame4, text='Lectura 1', fg = 'white', bg='gray10')
210187
lectura1.grid(column=0,row=0, sticky='nsew')
211188
lectura2 = Label(frame4, text='Lectura 2', fg = 'white', bg='gray10')
@@ -226,7 +203,6 @@ def coordenadas():
226203
frame5.columnconfigure(2, weight= 1)
227204
frame5.rowconfigure(0, weight= 1)
228205

229-
230206
stop = Button(frame5, text = 'DETENER', relief = "raised",bd=5, bg='orange',
231207
font=('Arial', 12, 'bold'), width =20, command = stop_boton)
232208
stop.grid(column=0, row=0, padx =10, pady=10, sticky='nsew')
@@ -246,35 +222,3 @@ def coordenadas():
246222
coordenadas()
247223
ventana.mainloop()
248224

249-
250-
251-
252-
253-
254-
255-
256-
257-
258-
259-
260-
261-
262-
263-
264-
265-
266-
267-
268-
269-
270-
271-
272-
273-
274-
275-
276-
277-
278-
279-
280-

0 commit comments

Comments
 (0)