im currently trying to create a button widget using Tkiner and would like to know how to get a number from that button when i click on it. I have tried lots of methods and ideas from different people and i still haven't got the right bit of code. any help is very helpful.
def createEight(self):
top=self.winfo_toplevel()
top.rowconfigure(0, weight=1)
top.columnconfigure(0, weight=1)
self.rowconfigure(0, weight=1)
self.columnconfigure(0, weight=1)
self.Button = Button ( self, text=" 8 ", font=("Arial", 12), bg="white", fg="blue", cursor="crosshair")
self.Button.grid(row=2, column=1, sticky=N+E+S+W)