Viktor Bondar
Viktor Bondar

Reputation: 15

can't understand why I'm running multiple Windows

I create a function where I perform actions with the grid of class Tk(). But when I run I have opened 2 or more Windows...

def gridOverriding(master):
    """
    Метод организовывает сетку в соответствии с дизайном приложения.
    """
    if type(master) is type(Tk()):
        master.columnconfigure(0, weight=1)
        master.rowconfigure(0, weight=0)
    else:
        messagebox.showinfo('Ошибка типов', 'Не верный элемент [1]!')
if __name__ == '__main__':
    app = Tk()
    app.title('Курсовая работа')
    app.geometry('800x600')
    gridOverriding(app)
    app.mainloop()

Upvotes: 0

Views: 47

Answers (1)

Bryan Oakley
Bryan Oakley

Reputation: 386240

This creates a window:

app = Tk()

... and this creates a window:

type(Tk())

Upvotes: 3

Related Questions