tuple_from_list.py
def get_some_data(): # Get some data from MySQL - ignore this bit. cur = MySQLdb.cursor() # Now, loop over each (single-field) result, and build a list. result = list() for row in cur.fetchall(): result.append(row[0]) # Make a tuple from the list and return. return tuple(result)

