import psycopg2 try: conn = psycopg2.connect(host="localhost", dbname="postgres", user="postgres", password="yourpassword") print("Connected successfully!") except ...