Answers for "how to create a python class in tkinter"

0

how to create a python class in tkinter

# Import
from tkinter import *
# Class Section
class Window(object):
  def __init__(self):
    self.tk = Tk()
    self.tk.title("Demo Window")
    self.tk.geometry("500x500")
    self.tk.resizable(0, 0)
    self.tk.mainloop()
    self.widgets()
    pass
  def widgets(self):
    lbl = Label(self.tk, text="Hello")
    lbl.pack()
    pass
win = Window()
Posted by: Guest on June-12-2021

Code answers related to "how to create a python class in tkinter"

Python Answers by Framework

Browse Popular Code Answers by Language