I'm using python 2.7 I'm writing some query in python
q = '''
select * from users where user_name = %(user_name)s and user_email = %(user_email)s
'''
I want to format the string in two step something like :
q2 = q % {'user_name':'david'}
q3 = q2 % {'user_email':'[email protected]'}
The example i wrote is not working. python throws KeyError is there any other option to perform those tasks?