Skip to content

Instantly share code, notes, and snippets.

@fmasanori
fmasanori / Copa2014.py
Last active August 29, 2015 14:23
Gastos da Copa 2014
#The context of this program is a course of an hour to journalists who know nothing about programming in a lab with Python 3 only.
import urllib.request
url = 'http://www.portaltransparencia.gov.br/copa2014/api/rest/empreendimento'
resp = urllib.request.urlopen(url).read().decode('utf-8')
total = 0
j = 0
and1 = '<andamento>'
and2 = '</andamento>'
abre = '<valorTotalPrevisto>'
fecha = '</valorTotalPrevisto>'