determining the bounds of a tuple returned from a database

ronrsr ronrsr at gmail.com
Fri Nov 17 02:01:39 EST 2006


very sorry, that was my error - len(result[0]) and len(result[1]) both
return 1 --

i think I'm misunderstanding what len() does - to me they appear to
have 2 or 3 elements, or at least be composed of a string of some
length.

I guess len() isn't the function i'm looking for then.  How do I tell
how many strings, or how many bytes are in each dimension?  so that I
can iterate through them.

Each entry in that list is a keyword - Alternately, is there any fast
way to parse that into a sorted list of distinct keywords.

very sorry for the error.

bests,

-rsr-

Fredrik Lundh wrote:
> ronrsr wrote:
>
> > it looks like the  len() function is the one I want.
> >
> > for:   len(result) - i get 248,
> >
> > but for len(result[0]) or len(result[1]) i always get 0.
>
> that's a bit surprising, because both items are tuples that contain
> exactly one item:
>
> >> (('Agricultural subsidies; Foreign aid',), ('Agriculture; Sustainable
> >> Agriculture - Support; Organic Agriculture; Pesticides, US, Childhood
> >> Development, Birth Defects; Toxic Chemicals',),
> 
> </F>




More information about the Python-list mailing list