Guest User

Untitled

a guest
Jan 7th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. cnx = connect(user=<...>,password=<...>,host=<...>,database=<...>)
  2. cursor = cnx.cursor()
  3. cursor.execute(sql)
  4. cnx.close()
  5.  
  6. with psycopg2.connect(user=<...>, password=<...>, host=<...>,
  7. database=<>) as cnx:
  8. cursor = cnx.cursor()
  9. cursor.execute(sql)
Add Comment
Please, Sign In to add comment