views:

61

answers:

2

I have a a wxPython checklist box that returns a list of integers. I want to use the integers to look up items in a dictionary. I am not really sure the best way to do this. Any suggestions?

+6  A: 

Are you asking for

[ someDict[k] for k in someList ]

?

S.Lott
That was it, still getting used to list comprehension. Thank you.
Kevin
A: 

Best bet is to use the for loop.

JadziaMD