[portland] Extracting strings from a tuple

Rich Shepard rshepard at appl-ecosys.com
Fri Nov 2 23:44:51 CET 2007

   While this should be simple, I cannot get it working and would appreciate
guidance on solving my problem.

   There is a database table with a single record. When I retrieve that
record I have a list consisting of a single tuple. However, that tuple has 7
strings; when printed it looks like this:

[(u'string 1', u'string 2', u'string 3', u'string 4', u'string 5', u'string
6', u'string 7')]

   What I want to do is walk through that tuple and extract each string.
However, I cannot successfully slice it, iterate through it, or use an index
to extract each string. According to "DIP," "Byte of Python," and other
books I should be able to get each string as a separate item.

   What have I missed?


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