22 lines
439 B
Python
22 lines
439 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from configparser import SafeConfigParser
|
|
import psycopg2
|
|
|
|
# Read conf.ini
|
|
ini_conf = "./conf.ini"
|
|
config = SafeConfigParser()
|
|
config.read(ini_conf)
|
|
|
|
# DB parameters
|
|
psql_host = config.get('psql', 'host')
|
|
psql_db = config.get('psql', 'database')
|
|
psql_user = config.get('psql', 'user')
|
|
psql_pwd = config.get('psql', 'passwd')
|
|
|
|
print(psql_host)
|
|
print(psql_db)
|
|
print(psql_user)
|
|
print(psql_pwd)
|