Created
July 30, 2020 05:17
-
-
Save CodeDrome/073fb80e3915d69202c9b350ac2edeb7 to your computer and use it in GitHub Desktop.
pgconnection.py
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
import psycopg2 | |
def get_connection(dbname): | |
connect_str = "dbname={} host='localhost' user='user' password='password'".format(dbname) | |
return psycopg2.connect(connect_str) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment