I am fairly new to working with tkinter in python and ran into trouble getting the name of some buttons created from a loop. In theory, pressing a button should print the name of the button pressed.
This is my code:
import tkinter as tk
def f ():
print ("Frame:", frm.winfo_children())
root = tk.Tk()
frm = tk.Frame(root)
for i in range (0,3):
bt = tk.Button(frm,text = str(i),name = str(i),command = f).pack()
frm.pack()
root.mainloop()