Tartalomjegyzék

< Tkinter

Tkinter kerettel

Hello világ

hello.py
import tkinter as tk
 
class App(tk.Frame):
    def __init__(self, master=None):
        super().__init__(master)
        self.master = master
        self.pack()
        self.create_widgets()
 
    def create_widgets(self):
        self.gomb1 = tk.Button(self)
        self.gomb1['text'] = 'Helló Világ'
        self.gomb1.pack()
 
 
root = tk.Tk()
app = App(master=root)
app.mainloop()

Forrás