[Baypiggies] csv module question

Vikram K kpguy1975 at gmail.com
Tue Feb 22 22:25:40 CET 2011


Consider the following python code which works perfectly:

fout = open ('1A_out.csv','w')

writer = csv.writer(fout)

writer.writerow(('Protein Name','gi Number', 'Peptide', 'Residue',
                 'Position in Protein', 'length', 'Window''))

I am writing the values in the csv file using a loop. Everything works fine.

Now in each row of the csv file i generated i need to append 36 values in 36
separate fields which i have captured in a dictionary data type. Will i have
to write out all the extra 36 fields names in the following line or is there
some better way?:

writer.writerow(('Protein Name','gi Number', 'Peptide', 'Residue',
                 'Position in Protein', 'length', 'Window''))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/baypiggies/attachments/20110222/51760af3/attachment.html>


More information about the Baypiggies mailing list