[portland] Indexing Lists of Tuples

Rich Shepard rshepard at appl-ecosys.com
Sat Sep 29 03:34:21 CEST 2007

On Fri, 28 Sep 2007, Jesse Hallett wrote:

> I just did some experimenting with your example. I was able to get at
> the element in question with L[1][5], just as you suggested. The only
> change I mad was to add a comma between the tuples that was probably
> left out when you pasted in the example.


   I was wrong in my reply. Here's another cut-and-paste from the python
output, and there is a comma between the tuples.

[(u'Low', u'HabitatComplexity', u'Terrestrial', u'Wildlife', u'Decay
S-Curve', 1, 0.0, 1.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0, 1.0), (u'High',
u'HabitatComplexity', u'Terrestrial', u'Wildlife', u'Growth S-Curve', 2,
0.0, 1.0, 0.0, 0.5, 0.0, 1.0, 0.5, 0.5, 1.0, 1.0)]

   Trying this interactively within ipython, it works for me, too.

   Now I'm really confused, because it's not working in my application! I
must be doing something subtly different in there. It's a wxPython method in
which I'm doing this. It works in ipython just fine, but not in the
application. Sigh. Perhaps this weekend I'll take the time to play more with

Apologies to everyone,


Richard B. Shepard, Ph.D.               |    The Environmental Permitting
Applied Ecosystem Services, Inc.        |         Accelerators(TM)
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863

More information about the Portland mailing list