Use execute()
to execute a query that returns data.
You'll either have to use a loop, or use a IN (id1, id2, id3)
where clause:
cur.execute('SELECT * FROM Genre WHERE id in ({0})'.format(', '.join('?' for _ in ids)), ids)
The above expression interpolates a separate ?
placeholder for every item in ids
(separated with commas).