[portland] Still Having List/Tuple Problems

Rich Shepard rshepard at appl-ecosys.com
Thu Apr 17 01:45:36 CEST 2008


On Wed, 16 Apr 2008, Dylan Reinhardt wrote:

> Take another look at the second block I sent:
>
> for key in grouper.keys():
>        print key
>        for value in grouper[key]:
>              print '\t%s' % value
>
> If you want to ensure you iterate over the keys in a particular order,
> you could update that with:
>
> for key in set([i[0] for i in my_tuple]):
>        print key
>        for value in grouper[key]:
>              print '\t%s' % value
>
> In what way is that not what you're looking for?

   Either will work, Dylan. I was working my way through the responses and
hadn't gotten to that one yet.

Thank you,

Rich

-- 
Richard B. Shepard, Ph.D.               |  Integrity            Credibility
Applied Ecosystem Services, Inc.        |            Innovation
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863


More information about the Portland mailing list