This question is likely noobish.
Instead of hardcoding the MySQLdb connection object: e.g,
db = MySQLdb.connect('localhost','name','pwrd','db_name')
How do I set it up so I can specify the db_name (or any other part of the connection object) from a list or some other variable. E.g:
for NAME from list_of_names:
db = MySQLdb.connect('localhost', 'name', 'pwrd', NAME)