I use the following code in Python (with pyodbc for a MS-Access base).
cursor.execute(\"select a from tbl where b=? and c=?\", (x, y))
It\'
You can use print cursor._last_executed to get the last executed query.
print cursor._last_executed
Read in this answer that you can also use print cursor.mogrify(query,list) to see the full query before or after executing.
print cursor.mogrify(query,list)