Advertisement
Guest User

Untitled

a guest
Aug 7th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import psycopg2
  2. import sys
  3.  
  4. def main():
  5. #Define our connection string
  6. conn_string = "host='192.168.38.99' dbname='testdb' user='testuser' password='teddy2003'"
  7.  
  8. conn = psycopg2.connect(conn_string)
  9.  
  10. # conn.cursor will return a cursor object, you can use this cursor to perform queries
  11. cursor = conn.cursor()
  12. print "Connected!\n"
  13.  
  14. if __name__ == "__main__":
  15. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement