Hi;<br>I have the following code:<br><br>cursor.execute('describe %s;' % store)<br>colFields, colFieldValues = [itm[0] for itm in cursor], [itm[1] for itm in cursor]<br>...<br>for col in colFields:<br>...<br>    print '<b>%s: </b>%s<br />\n' % (col, colValue[0])<br>
<br>Don't worry about the colValue[0]. In fact, the code throws no errors. However, when colValue[0] (which is called from the MySQL table) is a set as opposed to, say, a string, it prints out:<br>Set([])<br>which is natural, because there isn't anything in the set. What I'm trying to accomplish, however, is to offer a select of the possible values of that set as are available from the describe and caught in the tuple colFieldValues. For example, if I go to print, say, colFieldValues[20], which is a set, it prints out the whole set:<br>
set('Extra-small','Small','Medium','Large','XLarge','XXLarge','XXXLarge')
<br>But if I print out colFieldValues[20][0], it prints out "s". Now, I suppose I could do something like lop off the ends of colFieldValues[20] thus:<br>tmp = string.split(colFieldValues[20][4:-2], "','")<br>
but boy that's inelegant! Any better suggestions? Also, how can I test for it? It's an instance of string. How do I know if it's a set?<br>TIA,<br>Victor<br>