▶ Watch TTKBootstrap Playlist ✅ FREE Tkinter Widget Book bit.ly/3hphbwA bit.ly/3K4qlZC ▶ See More At: ✅ Subscribe To My TH-cam Channel: Tkinter.com bit.ly/3Pk1By4 ▶ MASSIVE TKINTER.COM DISCOUNT ✅ Join My Facebook Group: 30% off with coupon code: youtube bit.ly/2GFmOBz ▶ Get The Code For This Video ✅ Watch The 200 Video Tkinter Playlist bit.ly/3LQklWT bit.ly/3HAqZOd
Many thanks for this video, I learned a lot. If you are still looking for idea, you could add a sort function triggered when the user click in one treeview header: - first click in one header sort the record according to the colume content in ascending direction, - second click sort in descending direction and so on. - Click in a different header cell will restart by ascending sort for the new column selected. - The state is not preserved for the next program run.
This data editing solution is very good, thank you very much for sharing these solutions. However, when it comes to DateEntry in the ttkboostrap package I can't get it to work. The date field does not show the record date and keeps the default date. The same happens with cleaning this field to edit a new record. What solutions can you suggest to solve this problem? Working dates in a database is not easy, at least for me.
Thanks, great job. If you want I have more ideas for this channel, for example some applications when we can mark a place on Google maps and put some description for example for delivery company or interest place and share online. What you think?
Invalid column index ???? When running this code I got the following error: Invalid column index. This happens in the treeview column definition. is this a problem in python interpreter I should reinstall python? I have version 3.12
@@Codemycom import tkinter as tk from tkinter import ttk import sqlite3 def afficher_resultats_requete(table_name): # Créer une fenêtre fenetre = tk.Tk() fenetre.title(f"Résultats de la requête pour la table {table_name}") # Établir la connexion avec la base de données conn = sqlite3.connect('agrements.db') cursor = conn.cursor() # Exécuter la requête SELECT * cursor.execute(f"SELECT * FROM {table_name}") rows = cursor.fetchall() # Créer un Treeview tree = ttk.Treeview(fenetre) # Configurer la colonne cachée (d'index) tree.column("#0", width=0, stretch=tk.NO) # Largeur à 0 pour la cacher tree.heading("#0", text="", anchor=tk.W) # Texte vide pour la colonne cachée # Configurer les colonnes en fonction du nom des colonnes dans le résultat de la requête for col_name in cursor.description: tree.heading(col_name[0], text=col_name[0]) tree.column(col_name[0], width=100) # Insérer les données dans le Treeview for row in rows: tree.insert("", "end", values=row) # Ajouter le Treeview à la fenêtre tree.pack(expand=True, fill="both") # Démarrer la boucle principale fenetre.mainloop() # Appeler la fonction pour afficher les résultats pour la table 'nom_table' afficher_resultats_requete('nom_table')
▶ Watch TTKBootstrap Playlist ✅ FREE Tkinter Widget Book
bit.ly/3hphbwA bit.ly/3K4qlZC
▶ See More At: ✅ Subscribe To My TH-cam Channel:
Tkinter.com bit.ly/3Pk1By4
▶ MASSIVE TKINTER.COM DISCOUNT ✅ Join My Facebook Group:
30% off with coupon code: youtube bit.ly/2GFmOBz
▶ Get The Code For This Video ✅ Watch The 200 Video Tkinter Playlist
bit.ly/3LQklWT bit.ly/3HAqZOd
Many thanks for this video, I learned a lot.
If you are still looking for idea, you could add a sort function triggered when the user click in one treeview header:
- first click in one header sort the record according to the colume content in ascending direction,
- second click sort in descending direction and so on.
- Click in a different header cell will restart by ascending sort for the new column selected.
- The state is not preserved for the next program run.
excellent work, taught me a lot
Glad to hear it!
John, you're simply the best
thanks!
This data editing solution is very good, thank you very much for sharing these solutions. However, when it comes to DateEntry in the ttkboostrap package I can't get it to work. The date field does not show the record date and keeps the default date. The same happens with cleaning this field to edit a new record. What solutions can you suggest to solve this problem?
Working dates in a database is not easy, at least for me.
Thanks, great job. If you want I have more ideas for this channel, for example some applications when we can mark a place on Google maps and put some description for example for delivery company or interest place and share online. What you think?
we'll see. :-)
Awesome tutorial sir
Glad you enjoyed it!
can you do the same project with ttkbootstrap
As I said in the video...use the exact same code, just define the treeview like we did in last week's video where I discussed ttkbootstrap's treeview.
Thanks in advance,
I would like you to give us an example of extracting a PDF file from the database by exploiting data from the database
Hi, good job. Is there a way to get the files used in the live?
huh?
You are the man!
Thanks!
Very excellent, thank you sir
Welcome!
Is it possible to add numeric filtering to the columns in Tkinter?
Sure
@@TkinterPython Is that covered in a specific video?
@@tomkmb4120 Not sure, it might be in this one somewhere, you can check the tkinter playlist on my codemy.com youtube channel
Good information
Thanks!
thanks in advance ❤
just define your treeview using ttkbootstrap, the rest is the same.
Nice job Sir. Thanks. Where can i find the source code?
pinned comment, as always
I do not find the code. Where is it. Excuse my bad english
It is linked in the pinned comment.
Thanks
Welcome!
where is the code?
In the pinned comment, as always.
Thanks, I did no know about pinded comments and I did not know I would have to click show more to find it.
Invalid column index ???? When running this code I got the following error: Invalid column index. This happens in the treeview column definition. is this a problem in python interpreter I should reinstall python? I have version 3.12
No it's not a problem with python, you just messed up the code somewhere.
@@Codemycom import tkinter as tk
from tkinter import ttk
import sqlite3
def afficher_resultats_requete(table_name):
# Créer une fenêtre
fenetre = tk.Tk()
fenetre.title(f"Résultats de la requête pour la table {table_name}")
# Établir la connexion avec la base de données
conn = sqlite3.connect('agrements.db')
cursor = conn.cursor()
# Exécuter la requête SELECT *
cursor.execute(f"SELECT * FROM {table_name}")
rows = cursor.fetchall()
# Créer un Treeview
tree = ttk.Treeview(fenetre)
# Configurer la colonne cachée (d'index)
tree.column("#0", width=0, stretch=tk.NO) # Largeur à 0 pour la cacher
tree.heading("#0", text="", anchor=tk.W) # Texte vide pour la colonne cachée
# Configurer les colonnes en fonction du nom des colonnes dans le résultat de la requête
for col_name in cursor.description:
tree.heading(col_name[0], text=col_name[0])
tree.column(col_name[0], width=100)
# Insérer les données dans le Treeview
for row in rows:
tree.insert("", "end", values=row)
# Ajouter le Treeview à la fenêtre
tree.pack(expand=True, fill="both")
# Démarrer la boucle principale
fenetre.mainloop()
# Appeler la fonction pour afficher les résultats pour la table 'nom_table'
afficher_resultats_requete('nom_table')
I don't review code
Thanks
Welcome!