Python Forum
Listbox search code partially works
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Listbox search code partially works
Read your question out loud to yourself. The answer is there.

I think your problem is you are worrying too much about how to do stuff in python and it is preventing you from seeing how simple this is. I will rephrase your question.

I want to pick up all the rocks. How will I know when to stop picking up rocks?

I use rocks not because I think your head is full of rocks, but because most programming problems are so simple a cavman could do it (reference to old GEICO commercial in the USA). If programming was really hard there wouldn't be millions of people who can program. But new programmers often make the mistake of trying to design code at the keyboard. At the keyboard you need to think about syntax and spelling and punctuation and what commands are available and what arguments the commands take and..... When you become proficient in a language most of that stuff happens subconsciously, but when you are starting it can be overwhelming and make really smart people stupid.

Right now I have two pads of paper and pens and pencils sitting next to me. When I have a problem with the program I am working on it is the pencil and paper I reach for first, not the keyboard. I write my solution using pictures and natural language, not Python or C. When I am happy with the solution I translate it into programming language. Sometimes the translation requires modifications to the solution. but usually not.

Your problem is: If I want to process all the items in a list, how do I know when to stop?

See? Not any harder than picking up rocks.

Messages In This Thread
RE: Listbox search code partially works - by deanhystad - Mar-27-2020, 04:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] add search bar = search for input in all computer directory francisco_neves2020 15 6,928 Apr-14-2019, 07:29 PM
Last Post: francisco_neves2020
  Code fails on Mac, works on Windows and Raspberry Pi eugenedakin 4 2,521 May-30-2018, 03:49 AM
Last Post: eugenedakin
  [Tkinter] THow to search a string in a file and display it in listbox by Tkinter mosavit 2 4,078 Jun-21-2017, 08:02 AM
Last Post: buran

Forum Jump:

User Panel Messages

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