Home > Enterprise >  GUI runs with no errors but window doesn't appear
GUI runs with no errors but window doesn't appear

Time:01-02

Why i did not see my gui?

UI.py

from tkinter import *
BACKGROUND_COLOR = "#B1DDC6"
class FlashCard:
    def __int__(self):
        self.window = Tk()
        self.window.title("Flash Card")
        self.window.config(padx=50, pady=50, bg=BACKGROUND_COLOR)
        self.window.mainloop()

main.py from UI import FlashCard


FlashCard()

There is no error but gui not appear....

CodePudding user response:

In the FlashCard class, you typed __int__ instead of __init__.

Change def __int__(self): to def __init__(self): and it should work.

  • Related