diff --git a/main.py b/main.py index 43677ca..7f4c222 100644 --- a/main.py +++ b/main.py @@ -21,6 +21,7 @@ def remove_item(): def update_list(): + listbox.delete(0,listbox.size()) # clear listbox cur_time = (datetime.now() - datetime(1970, 1, 1)).total_seconds() + time.timezone total_time = [] @@ -37,7 +38,7 @@ def update_list(): print("UPDATE todo SET IMP = %s WHERE ID = %s" % (int(importance[i]), i + 1)) cur.execute("UPDATE todo SET IMP = %s WHERE ID = %s" % (int(importance[i]), i + 1)) print(i) - listbox.insert(tk.END, res[i][0]) + listbox.insert(tk.END, res[i][1]) con.commit() @@ -62,7 +63,7 @@ remove_button = tk.Button(root, text="Remove", command=remove_item) remove_button.pack(side=tk.LEFT, padx=5, pady=5) update_button = tk.Button(root, text="Update", command=update_list) -update_button.pack(padx=5, pady=5) +update_button.pack(side=tk.LEFT, padx=5, pady=5) # Run the Tkinter event loop root.mainloop() diff --git a/todo.db b/todo.db index 5913516..976169c 100644 Binary files a/todo.db and b/todo.db differ