Skip to content

Instantly share code, notes, and snippets.

@paydro
Last active December 12, 2019 18:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paydro/a37408aa0313456e08fd688fd921c87f to your computer and use it in GitHub Desktop.
Save paydro/a37408aa0313456e08fd688fd921c87f to your computer and use it in GitHub Desktop.
Connect to my local postgres database in python.
import psycopg2
conn = psycopg2.connect("")
cur = conn.cursor()
# now you can run queries
# cur.execute("SELECT 1")
# See http://initd.org/psycopg/docs/usage.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment