I have the following code for a "timer", but it does not appear in the window, just in the Python 3.6 console. How do I get it printed in the window? (note: the window only opens when the preset time ends)
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()