On Sun, 23 Nov 2008 17:55:48 +0000, Arnaud Delobelle
<[EMAIL PROTECTED]> wrote:
>But there is no reason why you should use a dictionary; just use a list
>of key-value pairs:

Thanks for the tip. I didn't know it was possible to use arrays to
hold more than one value. Actually, it's a better solution, as
key/value tuples in a dictionary aren't used in the order in which
they're put in the dictionary, while arrays are.

For those interested:

========
response = ">dummy</td>bla>good stuff</td>"
for name, pattern in patterns:
        m = pattern.search(response)
        if m:
                print m.group(1)
                break
        else:
                print "here"
========

Thanks guys.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to