Last active
August 15, 2020 07:02
-
-
Save aniruddha27/70099e5c18917e1b8449a67bf60ca87d to your computer and use it in GitHub Desktop.
This file contains 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
# Connecting to the Database | |
def DbConnect(query): | |
conn = psycopg2.connect(host="localhost",database="TwitterDB",port=5432,user=<user>,password=<password>) | |
curr = conn.cursor() | |
curr.execute(query) | |
rows = curr.fetchall() | |
return rows |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment