0
I have the following "timer" code, but it does not appear in the window, only in the Python 3.6 console. How to make it be printed in the window? (Obs.: the window only opens when the preset time is over)
from tkinter import*
from datetime import datetime, timedelta
from sys import stdout
from time import sleep
janela = Tk()
segundos = int("3")#tempo que comeca
tempo = timedelta(seconds=segundos)
while (str(tempo) >= "00:00:00"):
stdout.write("\r%s" % tempo)
tempo = tempo - timedelta(seconds=1)
sleep(1)
janela.title("tempo")
janela["bg"] = "white"
janela.geometry("500x500")
janela.mainloop()
If the window only opens after the time runs out, how do you want to show the time in the window?
– Woss
That’s what I want to know how to do!
– Edilei Zamarioli