Best Tkinter channel I have found! Someone who actually explains real world intermediate/advanced scenarios instead of just "How to create a main window and place a button".
Exactly what I needed, very well explained and easy to follow. If I can add a tip, the header height is determined by the first header column that tkinter creates. If you want to make the header taller you can add new line symbols to the beginning and end of the first column text like " Vehicle Type ". This would give you a three line header for all columns. Thanks again for this, I will be checking out your other videos as well.
Hi Jobin, and thank you for the nice tutorial. This was exactly what I needed. As I am french, I particularly appreciated the quality of the sound track and your crystal clear speech. About the topic, I would not have expected to have to dig in such details. I was hoping to find an editing feature out of the box in treeview. So, thank you again, Pierre.
Dall' italia sei un mito continua cosi, grazie 😀molte sto imparando molto (From Italy you are a legend, keep it up, thank you very much, I'm learning a lot)
Great tutorial :) Only suggestion I have is to include the code from the video as a downloadable file to make adapting it for use in other projects easier. Thank you :D
Excellent Tutorial, the most advanced and Informative video I have seen. I personally learn best be example and this video taught me a lot and explained a lot of things I had questions about. Thank you for your effort. Hopefully there will be a follow up video to get into more details on developing an application. Thank You!
among most of the tutorials which scratch just surface.. i found this one very helpful and explains core aspects to deal with updating excel sheet abstractly. Sir ( auther) why don't we make a python module which can help us update excel sheet upend a row without worrying about excel sheet content ( i mean number of columns and number of rows)?. I wish to join hands.
Thank you very much .. this is a genius solution to a problem that had me stumped for a while .. thank you a quick update : if the tree is in a frame, the bbox return wrong co-ordinates and this whole arrangement just don't work .. the tree must be a child of the main window or it wont work .. can you look into it ? thanks again
This is exactly what I need! Thank you for to this great video. It would be very helpful if you made the code available, its hard to type with the video
Hello Jobin, thank you for this video, this was quite useful. I have a couple of questions, can we 1. wrap the text within the cell and automatically increase the size of the row, 2. adding verical and horizontal scrollbars, 3. highlight a column and a cell individually with different color, if yes can you pl. make a video on formatting the Treeview control. thank you
Thanks very much for this tutorial Sir. It really helped me and works so well when I code same as you did. Please I have a little challenge Sir. When I create a treeview in a secondary dataframe the edit widget appears in another position from the actual cell I intend to edit, but when the new value is parsed and ‘Enter’ clicked the editing is done and the information gets in the right cell. This is also same when I change the position of the treeview in root Frame from .place(x=0, y=0) to another cordinate say .place(x=300, y=250). Please what can be done to correct this so that each time when I double-click the edit widget should appear just inside the cell I intend to edit as with the example you coded even in different sub-data frames having treeview. Thanks for your kind attention Sir.
Hello. Thanks for your comment. It appears to do the same thing for me when the treeview widget does not cover the whole window (for example, if it's only taking up a small portion of the window). I will look into this, thanks.
A couple of questions: Why do we record the column index and column iid? Is there a way to write pressed_on_enter without those recorded variables? I still don't understand how they work and why they should be under the entry_edit
I noticed that using "self.identify_row(event.y)" will basically do the same thing as "selected_iid = self.focus()" - both return row names like "I004", do you think using focus is better or not in this case? Why did you use focus?
this is helpful. have a question, when the entry widget is pop up, then move the scrollbar, how to move the entry widget accordingly so that the treeview table looks intact? Thank you very much
One way to deal with this situation is to hide the entry widget when the treeview widget is being scrolled or when the mouse wheel is used. In Linux, which is what I use, is used for wheel up (on the mouse) and is used for wheel down.
Can you make a video that contains searching elements without search bar and button. If user pressed any string key function will filter elements from rows and shows first matches as highligted on the middle of gui. For instances user typed "Nis" then function shows Nissan on the middle of gui as "Nis" is highlighted. Thanks for videos
Jobin. I'm using a pandas dataframe as the source for my editable treeview. I'd like the pass any values changed in the treeview back to the dataframe. I think I need to somehow pass the dataframe (created outside the class) into the class so that it knows about it and can edit it as part of the class's 'on_enter_pressed' function, but not sure how to do it. Hoping you can help.
Hello, Instead of using the Entry widget (which is limited to 1 line), you can use a different widget which supports multiple lines, such as tk.Text with a scrollbar. The text widget and scrollbar could be put into a Frame. Then set the height of the text widget to something that allows the user to type multiple lines. Then place the Frame on a treeview cell when the user wants to type something.
the program does not manage to work on my python console I have a python version 3.10 the latest version but when I run the program it tells me that ImportError: cannot import name 'InteractiveConsole' from 'code' and when I import InteractiveConsole it still doesn't work could you help me
Great video Jobin. What line(s) would I need to be changed when not wanting to use the "tree" column - i.e. not storing data in that column and using the following to hide it: treeview_vehicles['show'] = 'headings'
Hi @Ant, thanks for watching. The tree column uses the 'text' option to show text in cells for that column, so anything in the video example that uses the 'text' option may not be needed in your case (for example: treeview.insert(....text="tree column text"). When the tree column is hidden, only the 'values' option in the treeview is used for displaying text (example: treeview.insert(....values=("test", "value").
@@jobinpy Thanks Jobin. I'm populating my "editable" TreeView rows from a pandas dataframe. Would be great if you could do a video on how to expand the class to update a source pandas dataframe when you enter new values in the Treeview cell.
Buenos días, Alguien de casualidad tiene el código que el implemento u otro que este funcionando, tengo un error y no logro solucionarlo, y lo necesito para un proyecto de la universidad, gracias de ante mano
wow how to iterate (by for/while loop) between different cells in treeview a math method for example (maybe by numply/pandas): last rest = 10 (in column2 row1) new payment = 2 (in colum1 row 2) new rest = 8 (last rest - current payment) (in column2 row2) please consider to make video for this i think hondreads or thousands people will watch it
Hi, thanks for your comment. I think there are multiple ways to do this. The tutorial video shows the basics of getting and setting values in a treeview cell; you could perhaps use the ideas in the video and create a method in a custom treeview class to iterate rows/cells and calculate values.
if __name__ == "__main__" can be interpreted as "if this python script is the main startup script for the application and not being imported by another python script."
@@jobinpy But must it be included for the codes to run? Can the same objective be achieved without including that line.... It's really confusing for me!
still the best tk tutorial that actually teaches instead of just showing
Best Tkinter channel I have found! Someone who actually explains real world intermediate/advanced scenarios instead of just "How to create a main window and place a button".
excellent tutorial, straight to the point and addresses all needed. many thanks for sharing
Thanks for watching!
Superb Tutorial, fabulous teacher. One of the most lucid demonstrations of TreeView.
Thanks!
Exactly what I needed, very well explained and easy to follow. If I can add a tip, the header height is determined by the first header column that tkinter creates. If you want to make the header taller you can add new line symbols to the beginning and end of the first column text like "
Vehicle Type
". This would give you a three line header for all columns. Thanks again for this, I will be checking out your other videos as well.
Great tip! Thanks for the info and thanks for watching!
Great tutorial. You are a very good teacher. Thank you.
this was good, love to see a simple csv file opened and updated by this method
Hi Jobin, and thank you for the nice tutorial. This was exactly what I needed. As I am french, I particularly appreciated the quality of the sound track and your crystal clear speech. About the topic, I would not have expected to have to dig in such details. I was hoping to find an editing feature out of the box in treeview. So, thank you again, Pierre.
Thanks for your kind words!
I ve been searching this for a week. you are my savior. Thank you very much SIR!
Glad I could help!
This was so helpful. Your tkinter videos are unrivalled on the internet. Thank you so much
Thanks for your kind words!
My word you are a genuine genius this was VERY impressive indeed! Thank you for sharing
Dall' italia sei un mito continua cosi, grazie 😀molte sto imparando molto (From Italy you are a legend, keep it up, thank you very much, I'm learning a lot)
I've finished the tutorial, and it works perfectly! Thank you for your generosity!
Really excellent tutorial that I haven't seen like it before. Thanks. Thanks again
What an amazing tutorial.. Thank-you so much, I am looking forward to more of your videos..
Great tutorial :) Only suggestion I have is to include the code from the video as a downloadable file to make adapting it for use in other projects easier. Thank you :D
Excellent Tutorial, the most advanced and Informative video I have seen. I personally learn best be example and this video taught me a lot and explained a lot of things I had questions about. Thank you for your effort. Hopefully there will be a follow up video to get into more details on developing an application. Thank You!
Glad it was helpful!
this such a powerfull addition to tkinter
thank you so much
Thanks for watching!
Thank you very much for the explanation, besides being a beginner, it helped me a lot because I hadn't found anything that would help with this.
Glad it helped! Thanks for watching.
thanks Jobin ,.. this is video is truly amazing.. keep up the good work and share such amazing and informative videos.
👍
Thanks for your kind words!
This is what I've been searching for a month. Thank you so much brother. Expecting more videos and support.
Very detailed explanation, thanks a lot.
among most of the tutorials which scratch just surface.. i found this one very helpful and explains core aspects to deal with updating excel sheet abstractly. Sir ( auther) why don't we make a python module which can help us update excel sheet upend a row without worrying about excel sheet content ( i mean number of columns and number of rows)?. I wish to join hands.
Great tutorial, can i use say combo box widget than the entry widget and what about if I want the combo to replace where the sedan is only
30:55 why did you pass root into ttk.Entry? where is root defined?
Thank you very much .. this is a genius solution to a problem that had me stumped for a while .. thank you
a quick update : if the tree is in a frame, the bbox return wrong co-ordinates and this whole arrangement just don't work .. the tree must be a child of the main window or it wont work .. can you look into it ? thanks again
Great tutorial, but when I press enter or focus out of the entry widget, the contents of the cell disappear. Why is that?
Excellent, great subject matter and well presented.
This is exactly what I need! Thank you for to this great video. It would be very helpful if you made the code available, its hard to type with the video
Hello Jobin, thank you for this video, this was quite useful. I have a couple of questions, can we 1. wrap the text within the cell and automatically increase the size of the row, 2. adding verical and horizontal scrollbars, 3. highlight a column and a cell individually with different color, if yes can you pl. make a video on formatting the Treeview control. thank you
Thanks very much for this tutorial Sir.
It really helped me and works so well when I code same as you did. Please I have a little challenge Sir.
When I create a treeview in a secondary dataframe the edit widget appears in another position from the actual cell I intend to edit, but when the new value is parsed and ‘Enter’ clicked the editing is done and the information gets in the right cell. This is also same when I change the position of the treeview in root Frame from .place(x=0, y=0) to another cordinate say .place(x=300, y=250).
Please what can be done to correct this so that each time when I double-click the edit widget should appear just inside the cell I intend to edit as with the example you coded even in different sub-data frames having treeview.
Thanks for your kind attention Sir.
Hello. Thanks for your comment. It appears to do the same thing for me when the treeview widget does not cover the whole window (for example, if it's only taking up a small portion of the window). I will look into this, thanks.
Thats perfect and explained very detailed thank you
Glad it was helpful! Thanks for watching.
Hello dear , I want to know how to change a single cell color (bg or fg) in treeview
Amazing video brother, thanks for the help!
A couple of questions: Why do we record the column index and column iid? Is there a way to write pressed_on_enter without those recorded variables? I still don't understand how they work and why they should be under the entry_edit
this is just grand. Thank you very much
Glad you liked it! Thanks for watching.
this video is so useful teacher, so I have a question, how to save those entries to update database by selected the rows?
I noticed that using "self.identify_row(event.y)" will basically do the same thing as "selected_iid = self.focus()" - both return row names like "I004", do you think using focus is better or not in this case? Why did you use focus?
This tutorial is excellent!
Getting problem while number starts from zero example 00001 , it takes as 1 in tkinter treeview
this is helpful. have a question, when the entry widget is pop up, then move the scrollbar, how to move the entry widget accordingly so that the treeview table looks intact? Thank you very much
or how to just simply disable the scrolling action while a cell is double clicked for editing, then resume the scrolling capability afterwards?
One way to deal with this situation is to hide the entry widget when the treeview widget is being scrolled or when the mouse wheel is used. In Linux, which is what I use, is used for wheel up (on the mouse) and is used for wheel down.
Thank you so much@@jobinpy
Can you make a video that contains searching elements without search bar and button. If user pressed any string key function will filter elements from rows and shows first matches as highligted on the middle of gui. For instances user typed "Nis" then function shows Nissan on the middle of gui as "Nis" is highlighted.
Thanks for videos
I'll add that idea to my list of possible tutorial topics for future videos. Thanks!
How to calculate automatic math method like accountability between different columns and rows?
Jobin. I'm using a pandas dataframe as the source for my editable treeview. I'd like the pass any values changed in the treeview back to the dataframe. I think I need to somehow pass the dataframe (created outside the class) into the class so that it knows about it and can edit it as part of the class's 'on_enter_pressed' function, but not sure how to do it. Hoping you can help.
Thanks for explain line by line
This is brilliant!
How to generate grid lines in treeview sir... Please reply
Very helpful !!!
One question: Can you advise how to handle if a cell requires multi-lines, such as comments data ?
Hello,
Instead of using the Entry widget (which is limited to 1 line), you can use a different widget which supports multiple lines, such as tk.Text with a scrollbar. The text widget and scrollbar could be put into a Frame. Then set the height of the text widget to something that allows the user to type multiple lines. Then place the Frame on a treeview cell when the user wants to type something.
Thanks, nice lesson!
the program does not manage to work on my python console I have a python version
3.10 the latest version but when I run the program it tells me that ImportError: cannot import name 'InteractiveConsole' from 'code'
and when I import InteractiveConsole it still doesn't work
could you help me
This is very informative. I wonder there is a Python widget like this to read/write property trees similar to the Eclipse property edit panel.
Great video Jobin. What line(s) would I need to be changed when not wanting to use the "tree" column - i.e. not storing data in that column and using the following to hide it: treeview_vehicles['show'] = 'headings'
Hi @Ant, thanks for watching. The tree column uses the 'text' option to show text in cells for that column, so anything in the video example that uses the 'text' option may not be needed in your case (for example: treeview.insert(....text="tree column text"). When the tree column is hidden, only the 'values' option in the treeview is used for displaying text (example: treeview.insert(....values=("test", "value").
@@jobinpy Thanks Jobin. I'm populating my "editable" TreeView rows from a pandas dataframe. Would be great if you could do a video on how to expand the class to update a source pandas dataframe when you enter new values in the Treeview cell.
great sir,plz make a video of from date to end date search data filter row in python treeview with sqlite database, i try it but not made
Buenos días, Alguien de casualidad tiene el código que el implemento u otro que este funcionando, tengo un error y no logro solucionarlo, y lo necesito para un proyecto de la universidad, gracias de ante mano
t'a sauvé ma NSI, ehmercé la zone
Спасибо, все четко и ясно.
Thank you
That is a great tutorial!
Are you offering the code for download?
Thanks for watching! I don't have the code available online except in this video.
Excelente !!!
please share code also, thanks for this tutorial
Great, Perfect
Thanks!!
Please make full python course, Please
wow how to iterate (by for/while loop) between different cells in treeview a math method for example (maybe by numply/pandas):
last rest = 10 (in column2 row1)
new payment = 2 (in colum1 row 2)
new rest = 8 (last rest - current payment) (in column2 row2)
please consider to make video for this i think hondreads or thousands people will watch it
Hi, thanks for your comment. I think there are multiple ways to do this. The tutorial video shows the basics of getting and setting values in a treeview cell; you could perhaps use the ideas in the video and create a method in a custom treeview class to iterate rows/cells and calculate values.
Wow! This if __name__== __main__
Of what relevant is that line pls?
if __name__ == "__main__" can be interpreted as "if this python script is the main startup script for the application and not being imported by another python script."
@@jobinpy But must it be included for the codes to run? Can the same objective be achieved without including that line.... It's really confusing for me!
Hello sir
Btn.place(x=100,y=150)
pycharm does not execute this code
please upload code to github Sir.
Thank You~~As Always~~!!