Instalar psycopg2 (acesso a postgres)

Vá no gerenciador de pacotes (Adicionar e remover programas)

e procure

 

psycopg2

 

programa de teste (py):

 

import psycopg2
 
conexao = psycopg2.connect('host=127.0.0.1 dbname=BASE user=postgres password=SENHA')
cursor = conexao.cursor()
cursor.execute("select cd_base, nm_base from cadastro.tb_base limit 100")
result = cursor.fetchall()
for registro in result:
print registro[0],"-",registro[1]