class Main(tk.Frame): def __init__(self, root): super().__init__(root) self.init_main() def update(self): conn, cursor = BD().connect() cursor.execute('SELECT * FROM albums') for row in cursor.fetchall(): self.tree.insert('', tk.END, values=row) conn.commit() conn.close() self.tree.pack() class Child(tk.Toplevel): def __init__(self): super().__init__(root) self.init_child() def validation_of_entered_data(self, entry_description, combobox, entry_money): BD().add_item(description, combobox, entry_money) Main().update()
I need to execute the update function from another class, I tried to do it like this
Main().update()
But an error occurred, as I understand it, you need to pass some kind of argument, but I don’t know which one. Tell me what I need to do to correct the error?