On 02/08/18 21:12, Ali M wrote: > I tried writing the search_word function and binded it to the button, but > it doesn't work, please help i'm still a beginner. > > def search_word(self, tag): > esperanto = self.listbox.selection_set(0) > results = self.cur.execute("SELECT English FROM Words WHERE > Esperanto = ?", (esperanto,)) > for row in results: > self.textbox.delete(1.0, tk.END) > self.textbox.insert(tk.END, row[0])
The last bit looks suspicious. You delete the contents of textbox each time round the loop. Surely you only want to delete it once before the loop? -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor