Python Forum
[Tkinter] Displaying Data from a database and run a function when clicked?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Displaying Data from a database and run a function when clicked?
#1
Hello,

I am writing a simple GUI in Tkinter.

I want to connect to my database and show the data onto my GUI. There might be more data so a scroll bar needs to appear.

And when one of the rows of my data is clicked, I want to run some action, let's say that I want to run a function on that particular row of data.


Is this doable in Tkinter?
If not, is it possible in any of the other GUI designs??
Reply
#2
It can certainly be done in tkinter.
I would however recommend one of the following Kivy, QT5, or wxpython (pheonix)
My choice is wxpython. Here's an example that does most of what you want.
Hooking into a database (you disn't mention which one) is also easy and probably covered by the
wxpython demo.
Installation of wxpython is done using pip: pip install wxpython
the (most excellent) demo (and source code) program can be found here: https://github.com/wxWidgets/Phoenix
documentation here: https://docs.wxpython.org/wx.1moduleindex.html

and finally a gallery here: https://docs.wxpython.org/gallery.html
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Error verify data in database TomasSanchexx 2 861 Aug-11-2023, 12:37 PM
Last Post: TomasSanchexx
  PyQt5 form not displaying my data from SQLite3 Database Linuxdesire 2 4,927 Jan-10-2023, 09:51 PM
Last Post: gradlon93
  [PyQt] [Solved]Help displaying SQLite Database Extra 9 2,658 May-21-2022, 08:03 PM
Last Post: Extra
Question [Tkinter] data enterred through gui is not storing in sqlite3 database Hilal 21 7,313 Dec-15-2021, 08:48 PM
Last Post: Hilal
  [PyQt] Button clicked not working catlessness 10 8,085 Oct-21-2021, 12:36 PM
Last Post: catlessness
  [PyQt] How to update selected data in combobox displaying DB data? JokerSob 3 3,377 Aug-02-2021, 04:39 AM
Last Post: JokerSob
  [Tkinter] Hide clicked buttons Rubberduck 6 3,446 Jun-02-2021, 12:44 PM
Last Post: Rubberduck
  Displaying database info in QTableWidget thewolf 6 5,181 Apr-03-2021, 02:49 PM
Last Post: thewolf
  Button to add data to database and listbox SalsaBeanDip 1 2,806 Dec-06-2020, 10:13 PM
Last Post: Larz60+
  [tkinter] not getting checkbutton value when clicked OogieM 5 5,882 Sep-20-2020, 04:49 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020