def create_conn(config_name): db_info = config_dict[config_name].DB_INFO db = connection(db_info) return db
import code, sys from mesService.lib.pgwrap.db import connection if __name__ == '__main__': db_info = { 'database': 'flxuser1', 'user': '******', 'password': '******', 'host': 'huanglg.top', 'port': 5433, } cursor = connection() res = cursor.query("select * from employee") print(res) code.interact(local=locals())