firstly, I would like to apologize for my bad English.
I'm new to Python.
how is the new row selected automatically in this code?
I'm new to Python.
how is the new row selected automatically in this code?
def add_students(): con = sqlite3.connect("data.db") cur = con.cursor() cur.execute("INSERT INTO students VALUES (NULL, ?, ?)", (name_var.get(), class_var.get())) con.commit() cur.execute("select * from students ORDER BY class ASC ,name ASC") rows = cur.fetchall() if len(rows) != 0: my_treeview.delete(*my_treeview.get_children()) for row in rows: my_treeview.insert('', END, values = row) con.commit() con.close()