Created
May 29, 2021 11:49
-
-
Save ganny26/ca425e7648c8ea0e789739ae612a3153 to your computer and use it in GitHub Desktop.
query.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| query = """select name,address,city where pincode = '{}' and date = '{}'""".format(pincode, date) | |
| logging.info("executing query %s", query) | |
| cursor.execute(query) | |
| results = cursor.fetchall() | |
| response = [] | |
| for item in results: | |
| response.append( | |
| { | |
| "name": item[0], | |
| "address": item[1], | |
| "city": item[2] | |
| } | |
| ) | |
| logging.info("response %",response) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment