Lookup values from one table to another based on a value

koutoo at hotmail.com koutoo at hotmail.com
Thu Sep 20 12:22:11 EDT 2007


On Sep 20, 10:34 am, Bruno Desthuilliers <bruno.
42.desthuilli... at wtf.websiteburo.oops.com> wrote:
> kou... at hotmail.com a écrit :
>
>
>
>
>
> > If I wanted to accomplish looking up values from one table based on a
> > value from another table or file, how would I go about doing this in
> > Python?  Would I build a dictionary or an array?
>
> > exp:
>
> > Table1:
>
> > Site = 103
> > Lane = 2
> > Dir = ?  # Get this from Table2
>
> > Table2:
>
> > Site, Lane, Direction,
> > 103, 1, 1
> > 103, 2, 1
> > 103, 3, 5
> > 103, 4, 5
>
> > Normally in Access I would just use a Dlookup and be done with it, or
> > use a Recordset in VB.  Thanks guys.
>
> What about using a database ? Like SQLite ?
>
> Else, the canonical data structure for quick lookups is of course the dict.- Hide quoted text -
>
> - Show quoted text -


Ah, yes, that would appear to be a better means to retrieve data.  I
visited the site, which version should I download?  Thanks.

Kou




More information about the Python-list mailing list