i downt know how to filtering data #93
Unanswered
OtherwisePitt
asked this question in
Q&A
Replies: 1 comment
-
|
I get the data from database into pandas dataframe, then you can filter the data very easily. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
hi, i'm trying to filtering data based on value insert into an entry. but i dont know whats's wrong with my code
`def ricerca(event):
search_term = cerca_entry.get()
Table1.delete_rows([])
cursor.execute("PRAGMA table_info(anag_clienti)")
columns = [column[1] for column in cursor.fetchall()]
cursor.execute("SELECT * FROM anag_clienti")
rows = cursor.fetchall()
for row in rows:
if any(search_term in str(value).lower() for value in row):
Table1.update_values(values=[columns] + rows[:7])
db_filename = "anag_clienti.db"
db_path = os.path.abspath(os.path.join(os.path.dirname(file), db_filename))
conn = sqlite3.connect(db_path)
cursor = conn.cursor()
cursor.execute("PRAGMA table_info(anag_clienti)")
columns = [column[1] for column in cursor.fetchall()]
cursor.execute("SELECT * FROM anag_clienti")
rows = cursor.fetchall()
Table1 = CTkTable(master=root, width=1, height=32, corner_radius=7, values=[columns] + rows[:7], row=7, column=7)
Table1.place(x=27, y=166)
Beta Was this translation helpful? Give feedback.
All reactions