Manipulating MySQL Sets

Victor Subervi victorsubervi at gmail.com
Sun Dec 13 13:35:51 EST 2009


On Sun, Dec 13, 2009 at 12:40 PM, Victor Subervi <victorsubervi at gmail.com>wrote:

> On Sun, Dec 13, 2009 at 12:39 PM, Victor Subervi <victorsubervi at gmail.com>wrote:
>
> PS: I have another field that's a datetime with the same problem. How do I
> parse and otherwise work with that?
>

I have yet another problem with this. Once I've determined it's a Set or a
datetime, I do this:

                  for itm in colValue[0]:
                    try:
                      color, number = string.split(itm, ':')
                      html += "<option name='%s'>%s</option>" % (itm, color)
                    except:
                      html += "<option name='%s'>%s</option>" % (itm, itm)

The reason is I've entered my colors into my table as
nameOfColor:colorNumber and I want to break them out for presentation
purposes. However, the try never executes, only the except, and that
shouldn't be. I can slice the itm. What gives?
TIA,
V
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091213/95a4e771/attachment-0001.html>


More information about the Python-list mailing list