Python Forum

Full Version: Displaying Data from a database and run a function when clicked?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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??
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