0

I have a bunch of ttk.Entry variables, here are a few of them:

...
self.editor_friday_aleksandra = ttk.Entry(self, justify='center', width=11)
self.editor_friday_aleksandra.place(x=351, y=21)

self.editor_monday_benita = ttk.Entry(self, justify='center', width=11)
self.editor_monday_benita.place(x=71, y=41)
...

and would like to .delete() all of those in my reset_table() function:

def reset_table():
    days = ("monday", "tuesday", "wednesday", "thursday", "friday")
    names = ("aleksandra", "benita", "karolis", "zilvinas")
       
    if (self.copy_check == 0):
        for x in days:
            for y in names:
                self.editor_{x}_{y}.delete(0, 'end')              
    else:
        pass

But the above ends in String, so it doesn`t respond to the .delete. Tried the locals and globals, but get this: KeyError: 'self.editor_monday_aleksandra' (I might be doing it wrong though)

Is there a way to perform this kind of variable "suregery" and get away with it?

Infrael
  • 11
  • 2

0 Answers0