import psycopg2           
c=psycopg2.connect(host="localhost",dbname="COMUN",user="postgres",password="Visual2021")           
cur=c.cursor()           
cur.execute("select datname from pg_database order by 1")           
[print(r[0]) for r in cur.fetchall()]           
