Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created March 10, 2022 22:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/be8879e32ae07cca1e6ad6302a45b577 to your computer and use it in GitHub Desktop.
Save parzibyte/be8879e32ae07cca1e6ad6302a45b577 to your computer and use it in GitHub Desktop.
def obtener_lista_facturacion():
lista = []
with open(NOMBRE_ARCHIVO) as archivo:
next(archivo)
for linea in archivo:
datos_separados = linea.split(";")
año = int(datos_separados[0])
trimestre1 = float(datos_separados[1])
trimestre2 = float(datos_separados[2])
trimestre3 = float(datos_separados[3])
trimestre4 = float(datos_separados[4])
lista.append({
"año": año,
"trimestre1": trimestre1,
"trimestre2": trimestre2,
"trimestre3": trimestre3,
"trimestre4": trimestre4,
})
return lista
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment