I'm trying to use a Class (adns-python) which is expecting a list in the format:
domain_names = ["google.com", "yahoo.com"]
This is working when I declare the list that way manually. However, I'm trying to use a list returned from mysql using python-mysqldb.
When I look at what is being returned from mysql using:
type(mysql_rows)
This also shows as a list, but when view the result:
print(mysql_rows)
I can see the list is in the format:
[('google.com',), ('yahoo.com',)]
I've tried forcing the output to a list again using list(mysql_rows) which didn't work. I've tried parsing the text manually to make it look like the list using:
text_rows = "[" + ", ".join'"%s"' % i for i in mysql_rows = "]"
Which then shows as the correct format, but it is a string not a list so this doesn't work either.
This is my first few days learning python, so I'm sorry if this is an obvious/stupid question.
Thanks