Connect Treeview To Database - Python Tkinter GUI Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ธ.ค. 2024

ความคิดเห็น • 86

  • @Codemycom
    @Codemycom  3 ปีที่แล้ว +4

    ▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My TH-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/3gI9a33

  • @pauloafonsomedeiroskanda4836
    @pauloafonsomedeiroskanda4836 2 ปีที่แล้ว +1

    Hey Mr Elder, you are the best!! Thanks from Brazil. God bless your life.

  • @jackfreshdoe1327
    @jackfreshdoe1327 3 ปีที่แล้ว +1

    What a lad, really carrying me through computer science class

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว +1

      Happy to help!

  • @abrarmulla1196
    @abrarmulla1196 3 ปีที่แล้ว +2

    Lets gooooooooooo
    new vid
    i love your Tkinter vids
    thanks for teaching us all of this stuff.

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      Glad you like em!

  • @anurasenarathna1703
    @anurasenarathna1703 2 ปีที่แล้ว

    Great video series regarding TreeView. Thank you very much.

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว +1

      Glad you liked it!

  • @b391i
    @b391i 3 ปีที่แล้ว +1

    Keep going my friend you are the best 👍

  • @kevinrauer
    @kevinrauer 8 หลายเดือนก่อน

    Amazing, thanks John

    • @Codemycom
      @Codemycom  8 หลายเดือนก่อน

      Welcome!

  • @labialkosta261
    @labialkosta261 3 ปีที่แล้ว +3

    Great tutorial like always. Are we gonna see any flutter or react development in the future?

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว +1

      Never know

  • @aminalwashe3297
    @aminalwashe3297 2 ปีที่แล้ว

    Danke!

  • @yafethtb
    @yafethtb 2 ปีที่แล้ว +1

    Good video. The only thing I kinda disagree is when codes responsible for database creation and update are in one place with the codes responsible for the view part. For me it looks like a recipe for confused future maintenance.

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      It's trivial to split that into another file if it bothers you. With code this tiny, it's really not an issue. We aren't writing thousands of lines of code here.

  • @nonitaatienza6488
    @nonitaatienza6488 3 ปีที่แล้ว +1

    Hello john! I have a question about database, """ CREATE TABLE if not exists """ , is not working what i will do? my code editor is pycharm. Im from the Philippines

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      Don't use pycharm

    • @askpatti
      @askpatti 2 ปีที่แล้ว

      Try capitalizing all of "CREATE TABLE IF NOT EXISTS" then double-check your code is correct. Mine works in PyCharm.

  • @krzysztofskrzypek7170
    @krzysztofskrzypek7170 2 ปีที่แล้ว

    Your tutorial is awesome, god job:) i have only one question, your code have color text how i could turn on this?

  • @jerrysavarino2113
    @jerrysavarino2113 2 ปีที่แล้ว

    Hi John. I have managed to connect my Treeview to a DB in my app. The app allows a user to generate a report depending on certain checkbuttons, radiobuttons and comboxes that are selected. Instead of having to write out ALL sql statements and use 'if' statements that match what is selected, is there a simpler or easier way to do this? For example, I have a 'select' sql statement to display data but if a user selects a date such as 2019, is there a way to 'dynamically' get that value of that selection instead of having to specify '2019' in the sql statement? Hope it makes sense!

  • @shubhanshusharma5372
    @shubhanshusharma5372 3 ปีที่แล้ว +1

    Sir how to show color emoji on tkinter button and label i tried using emoji library but its shows black and white emojis

  • @devarajmanimaranYT
    @devarajmanimaranYT 2 ปีที่แล้ว

    Hi, Instead of defining column names, headings, and width, Is there a way treeview get all these after python fetches it from SQL table. You know...it will always won't be static right? the no of columns may change depending on which table we pull from database. I couldn't see any anywhere anyone who done this? Please pour some thoughts.

  • @Adrian-mh8op
    @Adrian-mh8op 2 ปีที่แล้ว

    I’m running mine inside a different function for a wider project but when I run it it says res=self.tk.call (self._w, “insert”, parent, index’
    _tkinter.TclError:Item 0 already exists.
    How do I fix that

  • @MMMEHTA99
    @MMMEHTA99 11 หลายเดือนก่อน

    Nice sir, Please Sir make one video of treeview all columns multipal data insert in sqlite database in python with one click

  • @ab123-j7v
    @ab123-j7v 2 ปีที่แล้ว

    Great, thanks!

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว +1

      Thanks for watching!

  • @danielalegriasallo5551
    @danielalegriasallo5551 3 ปีที่แล้ว

    Im loving it

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      Glad to hear it!

  • @markjocelyn5132
    @markjocelyn5132 3 ปีที่แล้ว

    Loving the tutorial as always. Are you going to cover saving the updates & new record etc to database in an uncoming video,? At the moment, changes and deletions etc are only on screen, not saved to database.

  • @seemslegit2924
    @seemslegit2924 3 ปีที่แล้ว

    Any ideea on how to solve multilines text appearance in treeview? For example if i have an multiline text before single line text, even if row heigth is set, the lines from the first text will appear on the next lines, as it is multiline. The row won't break the extend of multi lines text.
    Lets take 3 lines text followed by one line text:
    this
    magic
    text
    ---------
    that text
    This will be shown like:
    @This
    @That text ('magic' word blocked by the new line)
    -(continues)Text

  • @aneeshmalapaka8363
    @aneeshmalapaka8363 3 ปีที่แล้ว

    Hello sir, Hope you're safe, I have a doubt pls pls help sir.
    I am making an alarm and I wanna update the digits of clock by button press but my code is directly showing end numbers.
    if hour_label.cget("text") >=2:
    hour-=1
    hour_label.config(text=hour)
    print(hour)

    backward()
    else:
    button_back.config(state=DISABLED)
    button_forward.config(state=NORMAL)
    This way, if I press the back button it is giving 1 instead of showing other numbers. Pls suggest a solution, sir. Thank you.

  • @hamzabenabderrazek2542
    @hamzabenabderrazek2542 3 ปีที่แล้ว

    can you please make a video about the ttk.CheckBoxeTreeview with blop data type in it

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว +1

      blob isn't any different than any of the datatypes I've already done

  • @kidz967
    @kidz967 3 ปีที่แล้ว

    I love your tutorial. I learned a lot. Thank you! It is possible from that data can be print?

    • @kidz967
      @kidz967 3 ปีที่แล้ว

      I get some error 'Treeview' object has no attribute 'get'
      Why? I make some function to print the data.

  • @TOP123ization
    @TOP123ization 3 ปีที่แล้ว

    Your the best

  • @Kennethlumor
    @Kennethlumor 3 ปีที่แล้ว

    Sir please I want to ask why you don't like sharing the project code with us on github.. So that if we made mistakes we can refer to it

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      Of course I do, it's always posted in the pinned comment, as I say at the beginning of all videos.

  • @codeKeshav
    @codeKeshav 3 ปีที่แล้ว

    How to get the discription of table in sqlite3
    Like we have command in SQL as *desc tablename*

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      I have a course on python and sqlite3 if you're interested

  • @codewithraiju1424
    @codewithraiju1424 3 ปีที่แล้ว

    Hello sir.. The buttons of tkinter seems to be very old like those of windows 95.. We can change this by importing ttk from tkinter.. And we dont need to change anything much.. We just need to use button = ttk.Button instead of button = Button.. This will give us modern buttons of the current system we are using..

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว +3

      You can use any image you want to make buttons look any way you want. I have videos on that

    • @codewithraiju1424
      @codewithraiju1424 3 ปีที่แล้ว +2

      @@Codemycom Yes sir I saw that the video was great.. But sir we can use the official windows 10 buttons which look very cool by just using ttk.Button instead of Button

    • @codewithraiju1424
      @codewithraiju1424 3 ปีที่แล้ว

      @@Codemycom I would love if you see this ttk styling feature.. It is great.. I am very grateful to you as I have learned whole tkinter because of you.. And because of that I was able to create a simple python IDE.. ttk is great I added many new features like cuatom scrollbar.. It is also a gift from ttk module

  • @levin3722
    @levin3722 3 ปีที่แล้ว

    Hi thanks for the great tutorial !
    Can i also pull data from a sharepoint list ? If yes how ?

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      probably, though I don’t know sharepoint

  • @idukunda_lengo
    @idukunda_lengo 3 ปีที่แล้ว

    thumbs up for the YT algo....

  • @ayushpurwar525
    @ayushpurwar525 3 ปีที่แล้ว

    Sir please make a video on how to fetch all data from database and put it in treeview table.
    And also make a video on searching a particular row from treeview through Entry widget

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว +2

      I have, check the playlist

  • @azedinerahouti3534
    @azedinerahouti3534 3 หลายเดือนก่อน

    thik very ver much

  • @ipad_air
    @ipad_air 2 ปีที่แล้ว

    Hey everyone.
    I need a help,
    I've connected tree view to database, if I add a data from entry boxes it gets displayed on tree view. But if I exit and run it again it does not show previous entered data and totally refreshed although I've .commit() it at the end.
    Why?
    Anyone?

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว +1

      You didn't commit correctly

  • @Kimanxo
    @Kimanxo 3 ปีที่แล้ว

    please sir , guide me , i'm confused , i can decide what to choose , Tkiner or PyQt5 Or Pyside , i want one powerfull framework to with with with either simple and complex apps

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว +1

      It doesn't matter, learn them all

    • @Kimanxo
      @Kimanxo 3 ปีที่แล้ว

      @@Codemycom lol, ok sir i will , i'll count on your video , for tkinter you did well +170 videos

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว +1

      @@Kimanxo I already have a pyqt5 playlist

    • @Kimanxo
      @Kimanxo 3 ปีที่แล้ว

      @@Codemycom yes , i already watched all the videos in it , i wish you keep posting every week , thanks a lot

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว +1

      @@Kimanxo I do :-)

  • @artonodarmodjo6154
    @artonodarmodjo6154 ปีที่แล้ว

    You only use Integer or Real if you are going to perform math calculation on the field. Everything else (id, employee_nbr, zipcode etc.) is text.

  • @yashmittal4359
    @yashmittal4359 3 ปีที่แล้ว

    hiiii
    i just saw your kivy playlist will you also teach us how to make mobile apps with kivy if not please do that itd be realllllllly helpfulll
    big fan tho

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      That's what kivy is

  • @tazulislam2698
    @tazulislam2698 2 ปีที่แล้ว

    How to show more than 5000 rows in this table?

  • @abrarmulla1196
    @abrarmulla1196 3 ปีที่แล้ว +1

    and i cant believe i am the first person here

  • @markostanojevic4739
    @markostanojevic4739 3 ปีที่แล้ว

    i get error "Item 0 already exists" why?

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      You made an error in your code somewhere

  • @alkasinha8131
    @alkasinha8131 2 ปีที่แล้ว

    how to connect database created from different file sir?

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      In the same exact way

  • @PocketPixelsGO
    @PocketPixelsGO ปีที่แล้ว

    Please tell me you still view these comments from time to time. I need your help! Mine keep saying that table has 7 columns but 8 values were supplied and when I counted, there is 8 on everything!

    • @Codemycom
      @Codemycom  ปีที่แล้ว

      Maybe you have a typo in the code somewhere

    • @georgeganko4856
      @georgeganko4856 ปีที่แล้ว

      Seth, did you fix it yet?

  • @hiwab41
    @hiwab41 3 ปีที่แล้ว

    Nice

  • @neetasinghal7252
    @neetasinghal7252 3 ปีที่แล้ว +1

    Please provide source code on Github or another methode that you want.But please prvide source code 😟😟🙁🙁🙁

  • @rafaelgranado4168
    @rafaelgranado4168 ปีที่แล้ว

    No habia necesidad de insertar la data de forma tan complicada . Una forma podria ser :
    data = [
    ["A", 10, "C"],
    ["B", 8, "D"],
    ["E", 10, "F"]
    ]
    for product in data :
    conn.execute(""" INSERT INTO PRODUCTS VALUES(NULL, ?, ?, ?)""", product)
    o también:
    cursor.executemany(""" INSERT INTO PRODUCTS VALUES(?, ?, ?)""", data)
    Ambas te darán el mismo resultado

  • @abrarmulla1196
    @abrarmulla1196 3 ปีที่แล้ว +1

    How was your day?

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      So far so good

  • @georgeganko4856
    @georgeganko4856 ปีที่แล้ว

    Everything worked OK until the segment of code adding data from data.
    File "C:\Python310\Code\GUI in Python\Tutorial on Treeview\In dev Connecting Treeview to SQLite3 Database - Python Tkinter GUI Tutorial #173.py", line 76
    {
    IndentationError: unexpected indent
    [Finished in 115ms]
    Code: the INSERT line is in one line:
    for record in data:
    c.execute("INSERT INTO members VALUES(:id, last_name, :middle_name, :first_name, :status_active_or_inactive, :email_address, :date_received_as_member, :date_put_on_inactive, :date_from_inactive_to_active, :date_removed_from_list, :reason_for_removal, :last_known_as_member)", )
    {
    'id' : record[0],
    'last_name': record[1],
    'middle_name': record[2],
    'first_name': record[3],
    'status_active_or_inactive': record[4],
    'email_address': record[5],
    'date_received_as_member': record[6],
    'date_put_on_inactive': record[7],
    'date_from_inactive_to_active': record[8],
    'date_removed_from_list': record[9],
    'reason_for_removal': record[10],
    'last_known_as_member': record[11]
    }
    In the video there is a closing ), where did that come from?

    • @Codemycom
      @Codemycom  ปีที่แล้ว +1

      The error is saying that you didn't indent it correctly. Python is tab specific...the indentations have to be tabbed over correctly.