I have a data file with chemical names (one name per line) and want to load that into a Tkinter GUI listbox and then be able to select it by clicking on the line. Need some help.
sneekula
969
Nearly a Posting Maven
Recommended Answers
Jump to PostI had to fiddle with this for a while to get it to go. The scrollbar is a little hairy with Tkinter. Here is an example how to do this ...
# loading a Tkinter listbox with data and selecting a data line from Tkinter import * …
Jump to PostIn your case it would be easy to have a sorted listbox by simply loading it with a sorted list. So, replace the lines ...
# load the listbox with data for item in chem_list: listbox1.insert(END, item)
... with ...
# load the listbox …
All 6 Replies
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
sneekula
969
Nearly a Posting Maven
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
sneekula
969
Nearly a Posting Maven
bumsfeld
413
Nearly a Posting Virtuoso
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.