from tkinter import ttkimport tkinter as tk# Creating tkinter my_wmy_w = tk.Tk()my_w.geometry("260x280") my_w.title("# Using treeview widgettrv = ttk.Treeview(my_w, selectmode ='browse')trv.grid(row=1,column=1,padx=30,pady=20) # delete_button.Tkitner Treeview to get Parent Child nodes and display data in hierarchical order # delete_button = Button(button_frame, text="remover tudo",command=remove_all) Move_button = Button(button_frame, text="move row up", command=up) Move_button = Button(button_frame, text="move row down", command=down) Select_button = Button(button_frame, text="clear data", command=clear_record) Remove_button = Button(button_frame, text="remove data", command=remove_one) Update_id(row=0, column=0, padx=10, pady=10)Īdd_button = Button(button_frame, text="add data", command=add_records)Īdd_id(row=0, column=1, padx=10, pady=10) Update_button = Button(button_frame, text="changing data", command=update_records) Values = my_em(selected, 'values')īutton_frame = LabelFrame(root, text="COMANDOS")īutton_frame.pack(fill="x", expand="yes", padx=20) My_tree.move(row, my_tree.parent(row), my_tree.index(row) + 1) My_tree.move(row, my_tree.parent(row), my_tree.index(row) - 1) My_tree.tag_configure('oddrow', background="white") My_tree.heading("OID", text="OID", anchor=W) My_tree.heading("CLASS", text="CLASS", anchor=W) My_tree.heading("MOTHER", text="MOTHER", anchor=W) My_tree.heading("FATHER", text="FATHER", anchor=W) My_tree.heading("DOCS", text="DOCS", anchor=W) My_tree.heading("BIRTH", text="BIRTH", anchor=CENTER) My_tree.heading("NAME", text="NAME", anchor=W) My_tree.heading("ID", text="ID", anchor=W) My_lumn("BIRTH", anchor=CENTER, width=100) My_tree = ttk.Treeview(tree_frame, yscrollcommand=tree_scroll) Record, record, record, record, record, record, record, record), My_tree.insert(parent='', index='end', iid=count, text='', I would like some help to solve this problem, this is the code: from tkinter import *ĭata =, ,, ,, ],Ĭ.execute("""CREATE TABLE IF NOT EXISTS SCHOOL (Ĭ.execute("INSERT INTO SCHOOL VALUES (:ID, :NAME, :BIRTH, :DOCS, :FATHER, :MOTHER, :CLASS)", I’m trying to create a registration form with python tkinter sqlite3, but i have a problem, when i do the update of just one record, all the names are updated (not just the one that was selected), and i have also this issue when i try do add new data: “c.execute(“INSERT INTO SCHOOL VALUES (:ID, :NAME, :BIRTH, :DOCS, :FATHER, :MOTHER, :CLASS)”, sqlite3.IntegrityError: UNIQUE constraint failed: SCHOOL.CLASS”
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |