1
You guys all right? So, I’m doing a screen test program, its function would be just a test consisting of: Open a screen (called by a button) and close the one that was open. I don’t know how to do this, I’ve tried using loops, but unsuccessfully... Code: from Tkinter import *
def bt_click():
janela2 = Tk()
teste2 = janela2
janela2.title("Teste2")
janela2.geometry("200x200+300+300")
janela = Tk()
bt1 = Button(janela, text = "Click me", command = bt_click)
bt1.place(x = 50, y = 100)
janela["bg"] = "green"
janela.geometry("300x300+300+300")
janela.mainloop()
my idea was: Put the whole window in a while loop, and do so:
teste = 1
while teste == 1:
janela() ...
and when it called the other window(window 2), at the end of the function, make the test variable turn 2 or any other number, but I think that as the test variable falls within the function of the window2, it becomes local.. How to proceed? Hugs
Sorry for the mess of the code, when I passed to this text editor, it got messy :(
– Antônio Gally
When paste code here, select it and click on the formatting button
{}
upstairs.– jsbueno