Guest User

Untitled

a guest
Dec 4th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. import psycopg2
  2.  
  3. conn_string = "host='xxxx' dbname='xxx' user='xxx' password='xxx'"
  4. conn = psycopg2.connect(conn_string)
  5. cur = conn.cursor()
  6. cur.execute("query goes here")
  7. for row in cur.fetchall():
  8. print(row[0])
Add Comment
Please, Sign In to add comment