How to write a .csv file in Python including file definitions?

1

How can I create a csv file containing column width information and configured header and stuff like that, is it possible? or can we just write the data without any configuration?

    
asked by anonymous 24.01.2018 / 14:15

1 answer

3

Yes, it is possible.

An example of using the "," delimiter would be:

import csv
csvfile = "C:\pasta\arquivo.csv"
f=open(csvfile,'wb') # abre o arquivo para escrita apagando o conteúdo 
csv.writer(f, delimiter =' ',quotechar =',',quoting=csv.QUOTE_MINIMAL)

Check out more information on the site: link

    
24.01.2018 / 16:03