I don't understand what does comma after variable,
self.label = Label(master, text = 'This is our first GUI!')
in this code master is a variable but why it is here and why there is a comma after master
variable and how this line works?
Here is the full code
from tkinter import Tk, Label, Button
class MyFirstGUI:
def __init__(self, master):
self.master = master
master.title("A Simple GUI")
self.label = Label(master, text = 'This is our first GUI!')
self.label.pack()
self.greet_button = Button(master, text = 'Greet', command = self.greet)
self.greet_button.pack()
self.close_button = Button(master, text='close', command = master.quit)
self.close_button.pack()
def greet(self):
print("Hello User!!!")
root = Tk()
my_gui = MyFirstGUI(root)
root.mainloop()
Can someone explain how these lines work?
self.label = Label(master, text = 'This is our first GUI!'),
self.greet_button = Button(master, text = 'Greet', command = self.greet),
self.close_button = Button(master, text='close', command = master.quit)
The exact thing I need to know is how master, text='blah blah', blah blah thing work , is it assign text = 'blah blah' to master variable?