Python Forum
[Tkinter] Database with gui
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Database with gui
#4
You missed something. In my code I first ask for the selection.
index = list.curselection()
If there is no selection, this returns an empty collection of some type ({} I think). Then I test if the selection is empty and return out of the function if it is.
if not index:
    return
If index is not empty then I know it is save to ask for index[0].

I think you are doing this:
index = list.curselection()[0]
This does nothing to protect against an index error, and generates an index error if you try to get "index[0]" because index is already an integer.

You did not answer my question about search. What do you think is wrong with the search function? I played around with it a bit and it appears to work very well.
Reply


Messages In This Thread
Database with gui - by mark9 - Mar-19-2021, 08:26 PM
RE: Database with gui - by deanhystad - Mar-20-2021, 02:23 PM
RE: Database with gui - by mark9 - Mar-20-2021, 04:32 PM
RE: Database with gui - by deanhystad - Mar-20-2021, 05:23 PM
RE: Database with gui - by mark9 - Mar-21-2021, 09:33 AM
RE: Database with gui - by deanhystad - Mar-22-2021, 02:55 AM
RE: Database with gui - by mark9 - Mar-22-2021, 12:03 PM
RE: Database with gui - by deanhystad - Mar-21-2021, 09:30 PM
RE: Database with gui - by deanhystad - Mar-22-2021, 02:44 PM

Forum Jump:

User Panel Messages

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