I am trying to use a class (adns-python) that expects a list in the format:
domain_names = ["google.com", "yahoo.com"]
This works when I declare a list this way manually. However, I am trying to use the list returned from mysql using python-mysqldb.
When I look at what is returned from mysql using:
type(mysql_rows)
This also appears as a list, but when viewing the result:
print(mysql_rows)
I see that the list has the format:
[('google.com',), ('yahoo.com',)]
I tried listing the output again using a list (mysql_rows) that didn't work. I tried to parse the text manually so that it looked like a list using:
text_rows = "[" + ", ".join'"%s"' % i for i in mysql_rows = "]"
which is then displayed as the correct format, but it is a string, not a list, so this also does not work.
These are my first few days studying python, so I'm sorry if this is an obvious / stupid question.
thanks
source share