Skip to content

Instantly share code, notes, and snippets.

@lucasp90
Created October 15, 2016 18:20
Show Gist options
  • Save lucasp90/45b455e1a4322445a4b948f314d3653f to your computer and use it in GitHub Desktop.
Save lucasp90/45b455e1a4322445a4b948f314d3653f to your computer and use it in GitHub Desktop.
Ejemplo sencillo del uso de csv.writer
import csv
cuentas_twitter = [("@YouTube", 64341900, 17755), ("@KingJames", 33284155, 5096), ("@rushtheband", 224345100, 1329)]
with open('notas.csv', 'w') as arch_salida:
writer = csv.writer(arch_salida)
writer.writerow(['alias', 'seguidores', 'tweets'])
for cuenta in cuentas_twitter:
alias = cuenta[0]
seguidores = cuenta[1]
tweets = cuenta[2]
writer.writerow([alias, seguidores, tweets])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment