textvariable must be a tkinter.StringVar, not a raw string.
you can remedy this by declaring a string var in button_label, seting it from the argument variavel
and using the new StringVar as the textvariable (cod not tested):
you can remedy this by declaring a string var in button_label, seting it from the argument variavel
and using the new StringVar as the textvariable (cod not tested):
class Classe1(): def __init__(self): self.svar = StringVar() def button_label(self, chosen_row, textoescrito, variavel): self.svar.set(variavel) lb1 = Label(frame2, text=textoescrito, bg=color2, font=('Roboto', 11)) lb1.grid(row=chosen_row, column=2, padx=2, pady=2) self = Entry(frame2, width=50, font=('Roboto', 11), textvariable=self.svar) self.grid(row=chosen_row + 1, column=2, padx=2, pady=2)