here: https://docs.python.org/2/library/sqlite3.html I see the suggested way of building queries with python and sqlite3. In detail, I see this code:
t = (\'R