FAQ
Where do I obtain the value y used in nearest(y)?
Wouldn't that be sels[0]?

Scott Holmes wrote:
I've been trying to understand nearest(y) but I'm not getting it. I
have a ScrolledListBox with a list of people's names. I also have a
parallel list of the unique people numbers used in the PostgreSQL
database. When a name is selected from the scrolled list, I need to
determine the index value and then find the corresponding people number.


def selectionCommand(self):
sels = self.box.getcurselection()
if len(sels) == 0:
print 'No selection'
else:
print 'Selection:', sels[0]
print self.nmbr_list[self.box[0].nearest(y)]
self.lkupTopLevel.withdraw()

Where do I obtain the value y used in nearest(y)?

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 3 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedAug 5, '03 at 12:13a
activeAug 5, '03 at 5:45p
posts3
users2
websitepython.org

2 users in discussion

Scott Holmes: 2 posts Daniel P. Engel: 1 post

People

Translate

site design / logo © 2022 Grokbase