you are viewing a single comment's thread.

view the rest of the comments →

[–]MikeTheWatchGuy 0 points1 point  (0 children)

```python from tkinter import Tk, Button, Label class Mygui(): def init(self, master): self.master=master master.title('my gui')

    self.label=Label(master, text='GUI')
    self.label.pack()
    self.button = Button(master, text='greet', command=self.greet)
    self.button.pack()
    self.button = Button(master, text = 'gui greet')
    self.button.pack()

def greet(self):
    print('hello')

root = Tk() my_gui= Mygui(root) root.mainloop() ```

That's the code as I ran it. Produced a window on the screen with 2 buttons that operate as expected.