You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
740 B
30 lines
740 B
import psycopg2
|
|
from Config import *
|
|
#connection = psycopg2.connect(
|
|
# dbname="huiya_db",
|
|
# user="postgres",
|
|
# password="DsideaL147258369",
|
|
# host="10.10.14.71",
|
|
# port="5432"
|
|
# )
|
|
connection = psycopg2.connect(
|
|
# dbname=pg_dbname,
|
|
# user=pg_user,
|
|
# password=pg_password,
|
|
# host=pg_host,
|
|
# port=pg_port
|
|
dbname="huiya_db",
|
|
user="postgres",
|
|
password="DsideaL147258369",
|
|
host="10.10.14.71",
|
|
port="5432"
|
|
)
|
|
|
|
cursor = connection.cursor()
|
|
|
|
cursor.execute("SELECT * FROM t_dm_area;")
|
|
records = cursor.fetchall()
|
|
for record in records:
|
|
print(record)
|
|
|
|
connection.close() |