skip to Main Content

Im trying to make a project for School, so I tried using a code, but when am running the code, it is supposed to display the heading as ‘HOSPITAL MANAGEMENT SYSTEM’, but it is showing an empty

the below image has the code im using.
Code
and rather than showing the output needed, it’s showing blank output
Output

2

Answers


  1. Do that in your main function-

    • create a root tkinter window root=Tk()
    • create an instance of class and pass the object Hospital(root)
    • call mainloop when you are ready for your application to run. root.mainloop()
    Login or Signup to reply.
  2. Hi here is a code that make what I understand you want :

    import tkinter as tk
    from tkinter import ttk
    
    class App(tk.Tk):
      def __init__(self):
        super().__init__()
    
        self.title('HOSPITAL MANAGEMENT SYSTEM')
        self.geometry('250x250')
    
        self.label = ttk.Label(self, text='HOSPITAL MANAGEMENT SYSTEM')
        self.label.pack()
    
    if __name__ == "__main__":
      app = App()
      app.mainloop()
    

    Hope it is what you want

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search