Skip to content

Instantly share code, notes, and snippets.

@diegorocha
Created February 20, 2015 19:27
Show Gist options
  • Save diegorocha/41d446521dacff7a8c72 to your computer and use it in GitHub Desktop.
Save diegorocha/41d446521dacff7a8c72 to your computer and use it in GitHub Desktop.
Exemplo simples de escrita de itens de uma lista em um arquivo csv com Python. (Resultado de uma dúvida da lista PythonBrasil)
import csv
my_list = ["Matrix", "Blade Runner", "GodFather"]
new_csv = csv.writer(open("my_csv.csv", "wb"))
new_csv.writerow(["Nome do Filme"])
for row in my_list:
new_csv.writerow([row])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment