cursor.executemany('INSERT INTO candidate (name, address) VALUES (%s, %s)',
    [(v_dict['name'], v_dict['address'])] * len(v_dict))
Python equivalent of mysql_real_escape_string, for getting strings safely into MySQL?