How can I make a self-generating button?

  button, python-3.x, sqlite, tkinter

I’m attempting to create a function that will create a button named after a variable every time the submit to database function is used (1 button for every dataset submitted to my database). Currently I can get the button to name itself, but I’m having trouble offsetting the line for each time it’s used. I could just add a simple counter and set row=n, but at this point I’m not sure my approach to the problem is the best. For every dataset there needs to be a button generated for it. Would it be best to approach this by trying to run a program that makes buttons based on my dataset (not exactly sure how I’d do this) or by having my submit return a button with row=counter? Or is there another solution I haven’t thought of?
[snip of submit function][1]

**Note: Looking back on this my buttons don’t stay after the program restarts which makes sense. If I’m going to use the submit/counter solution I’ll also have to make the data store itself in the code.
[1]: https://i.stack.imgur.com/HjVhM.png

Source: Python-3x Questions

LEAVE A COMMENT