▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My UA-cam Channel: bit.ly/2UFLKgj bit.ly/2IGzvOR ▶️ See More At: ✅ Join My Facebook Group: Codemy.com bit.ly/2GFmOBz ▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt! Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN ▶️ Get The Code bit.ly/395TamW
Wow. I've been wanting to build a desktop-based database GUI with Python for years. This is the first clear, straightforward tutorial I've seen yet on how to do this with Tkinter. I've messed around with other GUI builders like wxPython, Qt, etc. but these are encumbered by installation and licensing hassles. Since Tkinter is already part of Python, I always wished I could use it for this purpose, but until recently it seemed like the documentation and learning resources for it were paltry. Thank you!
You have saved me from bashing my head right through my screen. The only thing I cannot seem to make work is the stripes, when I put the iid=count it always says that item 0 already exists and crashes, I can make it work without the iid argument though, if you can give me some advice on that I would appreciate it, if not, I understand that you might receive a lot of help requests like mine so no biggie. Thanks one again, your tutorials are the best and your attitude towards teaching is top notch as well
Sorry, all I can suggest is to put your code aside for a few days and then look at it with fresh eyes to discover what you did differently from the video..
Why use Global count? can't you can get a count directly from the for in command? Would the foillowing work with out the "evil global" count? for idx, values in enumerate(data):
I've been working on something like this for the past couple of weeks, so having this video has literally made my day! I've already got the database link working after a ton of other research but looking forward to when the next video is coming. When will the next one be released, is it a weekly thing?
@@Codemycom Hello John. Will the next video be up soon? I was following this tutorial for a similar project I've been set which would help me save a lot of time. I hope everything is ok with your family and look forward to part 2.
thx for your contribution! You stuff is great! One question: why my: my_tree.tag_configure('oddrow', background="white") my_tree.tag_configure('evenrow', background="lightblue") does not work properly? MacBook Pro, Sonoma 14.3 - there is one color of rows just! Do you have idea what is going on?
Struggling right now with TWO (or more) treeviews with stuff in one app. Don't mind the the layout. Each of them keeps their HIGHLIGHTED selection after switching frames. Found nothing helpful on the web. Bindings on TreeviewSelect or some controller class made it even worse. Thank you for your entertaining and informative content. Always an excellent show.
Lost almost three days over this issue. The whole project was in danger. Could it be a show stopping tkinter-bug? Unlikely,. Am I too stupid? Probably. Average noob, I would say. In the end, I've learned something. 😀 And I wouldn't have gotten this far without your help. Keep up your good work. 👍
Love the Video extremely helpful, one question, I want to display more than 10 rows in the Treeview table, I am unable to find what is restricting the display to 10 rows, I wanted to increase it to like 20 or so. Mind helping a newbie out? Been over the code many times, top to bottom and bottom to top. not finding it.
As far as I know, there's nothing in treeview that stops at 10 rows. You can by default have more than that. So there's something wrong with your code...I mean, we have more than 10 in the video above and you can clearly see I didn't do anything to make that happen besides what's in the video.
@@Codemycom Finally figured it out, Apparently Treeview defaults to display 10 rows, I added Height=15 and it worked. Guess you have to override the default.
hi, i've looking for a way to better custom my treeviw, here i found a way to improve it but not reach where i wana arave, unfortunatly the ctk dont have its own kind of treeview, and the documentation of Tkinter and ttk is really bad, do you know where should i look for?
Hi John, first thanks a million for this awesome tutorial ! I need to do the same thing but as a Web App. What would you suggest ? I would like to stick with Python and Mysql now I know those languages thanks to you :-) I'm ready to pay you if you would accept to do a step by step channel about this topic, like you did with the CRM with Tkinter.
can you help in the entry widget. There is a parameter 'show' whcih replaces the characters with the specified character. but how do we configure it to change back to show the original characters?
sir, I created the Tkinter software with a database(sqlite3). I install the software on the two computers. if I update the some recorded in the one computer it automatically updates that recorded in the other computer. how to make that software in Tkinter. please tell me any extras library are needed.
@@FoodKannadaVlog Sure, you just need to use a database online instead of one locally. My latest video shows you how: ua-cam.com/video/fRrR3shjFVY/v-deo.html
when i run the program before making trhe entry boxes, i get the following error: traceback (most recent call) File"home/pi/Desktop/"crmtreebase.py", liine 68, in ["eva", "Kingsley", 2, "123 anywhere st.", "anywhere", "LA", "12345"] typeerror: list indices must be integers or slices, not tuple How do i fix this?
I had the same problem, for me adding a comma at the end (after bracket) of all but the last row in the fake data made it work, I suspect that is how the fake data is setup but can't see it in the video as that edge is cutoff
@@Codemycom thanks, my goal is I have about 150 radio buttons and I can scroll them in a frame. On my pc it’s ok because of my screen resolution but on my older laptop because my resolution is low, it misses the lower options
Really like your video Build a CRM Tool With Treeview And Database - Python Tkinter GUI Tutorial, but I'm having trouble getting the CRM tool to run . The line "# Create Headings, my_tree.heading("#0",width = 0, stretch =NO) fails to compile with an error: unknown option "-width". This is odd because the line: my_tree.column("#0",width = 0, stretch =NO), works fine? Any Idea why this is happening? Second question: I get an error from the line: root.iconbitmap('c:/gui/codemy.ico'), how do I access the file 'c:/gui/codemy.ico'), Hope you can help I kinda jumped in to the middle of your videos and I'm sure you have explained these issues in one of your earlier videos.
I ran into another error I don't know how to handle. in the lines: for record in data: if count % 2 == 0: my_tree.insert(parent= '', index='end', iid=count, text='', values=(record[0], record[1], record[2], record[3], record[4], record[5], record[6]),tags=('evenrow',)) else: my_tree.insert(parent= '', index='end', iid=count, text='', values=(record[0], record[1], record[2], record[3], record[4], record[5], record[6]),tags=('oddrow',)) I am getting IndexError: string index out of range. I have no clue how to fix this error. Any suggestions?
How would you then out this data in a GUI? So if you had cars in a carpark, you could input the data in this format, then it would show you a map of where they were?
Does anyone know how to print to a printer from tkinter. A friend of mine wants to make a check register program and to print checks on his printer. I've searched all over the internet, but I can't find anything.
@@paullong4086 I'd maybe try the one called "Print A File - Build A Text Editor Part 8 - Python Tkinter GUI Tutorial #111" ua-cam.com/video/gkWtBrVq3W8/v-deo.html
Maybe make a hotfolder on desktop that is setup to print any file there, then make a python function to make a pdf in that folder with your content (look at reportlab for this)
Ahhh can anyone help, I know the ‘data’ part isn’t data that’s gonna be used, but I keep getting an error when it comes to the for loop, ‘NameError: name ‘data’ is not defined’. I don’t know how to fix it :(
I am getting error in line 24. Could you please help me out? self.tk.call(self._name, "map", style, *_format_mapdict(kw)), _tkinter.TclError: Invalid state name *
I'm following this video step by step and getting an error in segment Insert. SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='? # Add data to the screen global count count = 0 for record in data: if count % 2 == 0: my_tree.insert(parent=' ', index='end', iid=count, text=" ", values=(record[0], record[1], record[2], record[3], record[4], record[5], record[6], record[7], record[8], record[9], tags=('evenrow',)) else: my_tree.insert(parent=' ', index='end', iid=count, text=" ", values=(record[0], record[1], record[2], record[3], record[4], record[5], record[6], record[7], record[8], record[9], tags=('oddrow',)) # Increment counter count += 1 Traceback: File "C:\Python310\Code\GUI in Python\Tutorial on Treeview\# Build a CRM Tool With Treeview And Database - Py.py", line 104 record[8], record[9], tags=('evenrow',)) ^^^^^^^^^^^^^^^^^ SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='? I don't see where the error is. Please help.
▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My UA-cam Channel:
bit.ly/2UFLKgj bit.ly/2IGzvOR
▶️ See More At: ✅ Join My Facebook Group:
Codemy.com bit.ly/2GFmOBz
▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt!
Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN
▶️ Get The Code
bit.ly/395TamW
Wow. I've been wanting to build a desktop-based database GUI with Python for years. This is the first clear, straightforward tutorial I've seen yet on how to do this with Tkinter. I've messed around with other GUI builders like wxPython, Qt, etc. but these are encumbered by installation and licensing hassles. Since Tkinter is already part of Python, I always wished I could use it for this purpose, but until recently it seemed like the documentation and learning resources for it were paltry. Thank you!
Glad you enjoyed it!
I really loved your videos on tkinter. It would have taken me years to learn as much as I could learn within a week. Cheers!
Glad you're enjoying them!
I was a CRM developer using PHP who's relearning python now and this made for an interesting video!
Glad you enjoyed it!
love your positive way of teaching ! thank you so much :)
So nice of you
You have saved me from bashing my head right through my screen. The only thing I cannot seem to make work is the stripes, when I put the iid=count it always says that item 0 already exists and crashes, I can make it work without the iid argument though, if you can give me some advice on that I would appreciate it, if not, I understand that you might receive a lot of help requests like mine so no biggie.
Thanks one again, your tutorials are the best and your attitude towards teaching is top notch as well
Sorry, all I can suggest is to put your code aside for a few days and then look at it with fresh eyes to discover what you did differently from the video..
Why use Global count? can't you can get a count directly from the for in command?
Would the foillowing work with out the "evil global" count?
for idx, values in enumerate(data):
I had a project planned that this could almost be directly applied to in order to get me started. Thanks for reading my mind.
Any time!
I've been working on something like this for the past couple of weeks, so having this video has literally made my day! I've already got the database link working after a ton of other research but looking forward to when the next video is coming. When will the next one be released, is it a weekly thing?
Yeah I do Tkinter every Tuesday
@@Codemycom hello, will the next video been released soon?
@@benmyg I've had a family emergency and will be out of town for a bit. New videos are on hold till I return, hopefully soon.
@@Codemycom Hello John. Will the next video be up soon? I was following this tutorial for a similar project I've been set which would help me save a lot of time. I hope everything is ok with your family and look forward to part 2.
@@benmyg I hope to resume regular schedule next week.
thx for your contribution! You stuff is great! One question: why my:
my_tree.tag_configure('oddrow', background="white")
my_tree.tag_configure('evenrow', background="lightblue")
does not work properly? MacBook Pro, Sonoma 14.3 - there is one color of rows just! Do you have idea what is going on?
Struggling right now with TWO (or more) treeviews with stuff in one app. Don't mind the the layout. Each of them keeps their HIGHLIGHTED selection after switching frames. Found nothing helpful on the web. Bindings on TreeviewSelect or some controller class made it even worse. Thank you for your entertaining and informative content. Always an excellent show.
Lost almost three days over this issue. The whole project was in danger. Could it be a show stopping tkinter-bug? Unlikely,. Am I too stupid? Probably. Average noob, I would say. In the end, I've learned something. 😀 And I wouldn't have gotten this far without your help. Keep up your good work. 👍
thanks a lot, From São Paulo/Brasil
You're welcome!
It's very informative ..👍
Thanks for liking
Love the Video extremely helpful, one question, I want to display more than 10 rows in the Treeview table, I am unable to find what is restricting the display to 10 rows, I wanted to increase it to like 20 or so. Mind helping a newbie out? Been over the code many times, top to bottom and bottom to top. not finding it.
As far as I know, there's nothing in treeview that stops at 10 rows. You can by default have more than that. So there's something wrong with your code...I mean, we have more than 10 in the video above and you can clearly see I didn't do anything to make that happen besides what's in the video.
@@Codemycom Finally figured it out, Apparently Treeview defaults to display 10 rows, I added Height=15 and it worked. Guess you have to override the default.
I made app for my mom using what I was taught today c: .She liked it. Kinda difficult to make y'all understand what it was about.
Nice!
You deserve the best. Thnks ❤❤❤
Thanks!
Gracias, From Argentina!
Thanks!
You are a wonderful person i love you
is there a way to dinamically set the width of the columns in the treeview widget?
That's great. Thank you
What should i do for calling data from an external database, how should I call it into the treeview? Is there any suggestions?
Yeah, as I said in this video...I'll discuss that in the next video...
Fantastic
Thanks!
GOOD JOB TEACHER
Thanks!
this is incredible, thank you
Very welcome!
Sir can you please tell me which application you are using for coding..
Thank you in advancr
Sublime text editor and git bash terminal from git-scn.com
Great video and explains
Glad you liked it!
this is a cool application
thanks!
Awesome! Thank you :)
Welcome!
hi, i've looking for a way to better custom my treeviw, here i found a way to improve it but not reach where i wana arave, unfortunatly the ctk dont have its own kind of treeview, and the documentation of Tkinter and ttk is really bad, do you know where should i look for?
no
Thank you, огромное спасибо!!
Welcome!
Thanks!
Thanks, appreciate it!
Hi John, first thanks a million for this awesome tutorial !
I need to do the same thing but as a Web App. What would you suggest ?
I would like to stick with Python and Mysql now I know those languages thanks to you :-)
I'm ready to pay you if you would accept to do a step by step channel about this topic, like you did with the CRM with Tkinter.
I suggest Django. I don't have any plans to do a step by step on it tho at the moment. You can email me at john@codemy.com about it.
Good video! Thanks!
Thanks for watching
Thank you very much !
Very Welcome!
great content
Thanks!
Thanks a lot!!
Great... Thanks a lot..
Sure thing
thank you sura gean
:-)
Hi, what did you set in yscrollcommand? yscrollcommand=tree_scroll.set()
yscrollcommand=tree_scroll.set
Great, thanks
Thanks for watching!
Hello John ELDER. I want to know if there is a mean to connect python with an access file. Thank you.
Yes there is but I don't have any videos on that. You need a third party thing like pyodbc or something like that
Awesome!!!
Thanks!!
can you help in the entry widget. There is a parameter 'show' whcih replaces the characters with the specified character. but how do we configure it to change back to show the original characters?
sir, I created the Tkinter software with a database(sqlite3).
I install the software on the two computers.
if I update the some recorded in the one computer it automatically updates that recorded in the other computer.
how to make that software in Tkinter. please tell me any extras library are needed.
please tell me if it is possible in Tkinter or not
@@FoodKannadaVlog Sure, you just need to use a database online instead of one locally. My latest video shows you how:
ua-cam.com/video/fRrR3shjFVY/v-deo.html
Can't we do all these things without using tree view function i.e we can do via listboxes
No
how can i change treeview color for programm allready exists?
Is it your program that you wrote? If so, easily and I have videos for that.
Nice video!
Thanks!
when i run the program before making trhe entry boxes, i get the following error:
traceback (most recent call)
File"home/pi/Desktop/"crmtreebase.py", liine 68, in
["eva", "Kingsley", 2, "123 anywhere st.", "anywhere", "LA", "12345"]
typeerror: list indices must be integers or slices, not tuple
How do i fix this?
I had the same problem, for me adding a comma at the end (after bracket) of all but the last row in the fake data made it work, I suspect that is how the fake data is setup but can't see it in the video as that edge is cutoff
Have you a video on scroll bars on canvas? Had a look on the play list but couldn’t see
Yeah it's in there...you can always put the canvas in a frame and scroll the frame too.
@@Codemycom thanks, my goal is I have about 150 radio buttons and I can scroll them in a frame. On my pc it’s ok because of my screen resolution but on my older laptop because my resolution is low, it misses the lower options
Really like your video Build a CRM Tool With Treeview And Database - Python Tkinter GUI Tutorial, but I'm having trouble getting the CRM tool to run .
The line "# Create Headings, my_tree.heading("#0",width = 0, stretch =NO) fails to compile with an error: unknown option "-width". This is odd because the line: my_tree.column("#0",width = 0, stretch =NO), works fine?
Any Idea why this is happening?
Second question: I get an error from the line: root.iconbitmap('c:/gui/codemy.ico'), how do I access the file 'c:/gui/codemy.ico'),
Hope you can help I kinda jumped in to the middle of your videos and I'm sure you have explained these issues in one of your earlier videos.
lines that start with # are comments. They are ignored by python. So that line isn't the problem.
I ran into another error I don't know how to handle. in the lines:
for record in data:
if count % 2 == 0:
my_tree.insert(parent= '', index='end', iid=count, text='', values=(record[0], record[1], record[2], record[3], record[4], record[5], record[6]),tags=('evenrow',))
else:
my_tree.insert(parent= '', index='end', iid=count, text='', values=(record[0], record[1], record[2], record[3], record[4], record[5], record[6]),tags=('oddrow',))
I am getting IndexError: string index out of range.
I have no clue how to fix this error. Any suggestions?
How would you then out this data in a GUI? So if you had cars in a carpark, you could input the data in this format, then it would show you a map of where they were?
This is a GUI, not sure what you mean...
@@Codemycom So like assign them a location on a map for example, then output that into a GUI.
@@Discodave676 lots of ways to do that, but I don't have any videos on maps.
@@Codemycom Ok thanks for the feedback! A drag and drop>database>parking lot management system would be a good one if you want any ideas!
Is there a part 2 for this tutorial ? ❤️🙏
yeah coming soon, tkinter videos come on Tuesdays
get the code at github.com/flatplanet/Intro-To-TKinter-UA-cam-Course/blob/master/treebase.py
John sir, How to take the Thumbnail image of mp3 song in tkinter window, Please tell us.
I have videos on the playlist showing how to add images.
It is not adding records can you help?
You’ll have to rewatch the videos and figure out what you left off.
Does anyone know how to print to a printer from tkinter. A friend of mine wants to make a check register program and to print checks on his printer. I've searched all over the internet, but I can't find anything.
I think I have a video on basic print stuff on the playlist here
@@Codemycom Thanks. Do you which video it is in? I looked through the playlist but nothing popped out at me about working with printers.
@@Codemycom I found the tutorial (111). I use Linux so I don't think win32api will work for me. Very nice tutorials just the same, Thanks again.
@@paullong4086 I'd maybe try the one called "Print A File - Build A Text Editor Part 8 - Python Tkinter GUI Tutorial #111"
ua-cam.com/video/gkWtBrVq3W8/v-deo.html
Maybe make a hotfolder on desktop that is setup to print any file there, then make a python function to make a pdf in that folder with your content (look at reportlab for this)
Ahhh can anyone help, I know the ‘data’ part isn’t data that’s gonna be used, but I keep getting an error when it comes to the for loop, ‘NameError: name ‘data’ is not defined’.
I don’t know how to fix it :(
Define data
Sir please show how to print that data by printer connection . request sir
noted
@@Codemycom thank u sir.
@@journeytowardscoding7620 Welcome!
today second view
Nice!
How to focus in treeview
please tell me sir
just click on it, right?
@@Codemycom sir i need auto focus by default
@@anilthakur8988 widget_name.focus_set()
@@Codemycom sir create video auto focus in treeview widget please
@@anilthakur8988 I already told you how to do it. That one line of code is all you need
When will you upload next video john(Walter white) :P?
I am getting error in line 24. Could you please help me out?
self.tk.call(self._name, "map", style, *_format_mapdict(kw)),
_tkinter.TclError: Invalid state name *
When I return from my family emergency
@@Codemycom I am getting error john. Could you please help me out.....?
maybe" Build a CRM Tool With Treeview And Database " + SQLite xD
yeah we'll be using sqlite as the database
No Tkinter anymore ?? 😥
I'm out of town on a family emergency, they will resume when I return
style = ttk.Style() opens a new empty window.
no it doesn't
HELLO TEACHER WE WAIT A NEXT VIDEO #173 TO COMPLET THIS PROJECT
yes, I'm out of town with a family emergency. Will resume when I return.
I'm following this video step by step and getting an error in segment Insert. SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
# Add data to the screen
global count
count = 0
for record in data:
if count % 2 == 0:
my_tree.insert(parent=' ', index='end', iid=count, text=" ",
values=(record[0], record[1], record[2], record[3],
record[4], record[5], record[6], record[7],
record[8], record[9], tags=('evenrow',))
else:
my_tree.insert(parent=' ', index='end', iid=count, text=" ",
values=(record[0], record[1], record[2], record[3],
record[4], record[5], record[6], record[7],
record[8], record[9], tags=('oddrow',))
# Increment counter
count += 1
Traceback:
File "C:\Python310\Code\GUI in Python\Tutorial on Treeview\# Build a CRM Tool With Treeview And Database - Py.py", line 104
record[8], record[9], tags=('evenrow',))
^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
I don't see where the error is. Please help.
don't chop things up on separate lines like you are doing
my_tree.insert(parent='', index='end', iid=count, text='', values=(record[0], record[1],record[2], record[3],record[4],record[5],record[6], tags=('evenrow',))
^
SyntaxError: invalid syntax
I dont understand
you didn't close the parentheses at the end of record[6] in values
Ugh, tkinter must have changed a ton with Treeview widgets, none of this stuff works now. Especially the headings.
Nope, literally nothing has changed at all. You're just doing something terribly wrong.