,运行上边代码验证代码无错误,基本算是安装完成了。...建立数据库连接
conn = psycopg2.connect(dbname="mydb", user="postgres",
password="1234", host="127.0.0.1...(dbname="mydb", user="postgres",
password="1234", host="127.0.0.1", port="5432")
# 创建cursor以访问数据库...API & 描述
1 psycopg2.connect(database=”testdb”, user=”postgres”, password=”cohondob”, host=”127.0.0.1...”, port=”5432”)
这个API打开一个连接到PostgreSQL数据库。