Postgres Set Variable Python Print Dictionary To File