[Tutor] How to show the listbox from sqlite and make it searchable?
alan.gauld at btinternet.com
Mon Aug 3 23:11:06 CEST 2015
On 03/08/15 13:22, Ali Moradi wrote:
> hi, this is my code (
OK I had a look at the code this time. Several points:
You never set your listbox in the GUI - there is no call to grid().
Your button has no command attached to it so it does nothing
Your SQL function has a self parameter but is not a
method of an object. You try to insert self into the
list widget. What do you think self will contain?
In fact it never gets called so its irrelevant, but
if it did get called what would it contain?
It looks like you are just cutting and pasting code from
somewhere without really thinking about what it does or
how it all fits together? You need to slow down and
build it piece by piece. (I seem to recall having a
similar discussion with you a couple of months ago?
Yes, back in June.) For now, just get the GUI built
with some dummy text. Then get the searching to work
using your fixed text. Finally swap the text for the
result of a SQL query.
Don't rush at it and it will go faster.
Author of the Learn to Program web site
Follow my photo-blog on Flickr at:
More information about the Tutor