Código
from tkinter import Tk,Label,Button,Frame proceso=0 def iniciar(contador=0): global proceso time['text'] = contador proceso=time.after(1000, iniciar, (contador+1)) def parar(): global proceso time.after_cancel(proceso) root = Tk() root.title('Cronometro') time = Label(root, fg='red', width=20, font=("","18")) time.pack() frame=Frame(root) btnIniciar=Button(frame, fg='blue', text='Iniciar', command=iniciar) btnIniciar.grid(row=1, column=1) btnParar=Button(frame, fg='blue', text='Parar', command=parar) btnParar.grid(row=1, column=2) frame.pack() root.mainloop()
A mi este código me funciona. Debería ser igual. Escribe todo tu código de esta manera, donde dice aquí y quita los espacios.
[ code=python ] Aqui [ /code ]
Lo probe quitando los espacios i me saldo error en la linia 3, me estado peleando un rato con la composicon i no hay manera