parsing csv files class

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Sat Dec 27 21:15:58 CET 2008


En Sat, 27 Dec 2008 11:02:13 -0200, Gary M. Josack <gary at byoteki.com>  
escribió:
> alex goretoy wrote:

>> I know it's messy with all those self.soc.* functions, but it works in  
>> one of my current project. I just want to make it more pythonic I also  
>> want to add capability for makeing csv file if I give it input like:
>> 1234,something nice, hey this is something nice
>> 2468,something else, something else

>>                 reader = csv.reader(file(filename, "rb"))
>>                 try:
>>                     for row in reader:
>>                         self.buffer.append(row)
>>                         s,a=[],{}

> Do you know that there is a csv module in the standard library already?

I'd say he already knows, he even used it in the code.

To Alex G.: I didn't understand what's the purpose of this class. Probably  
you want to do too much things in the same place; looks like it has  
multiple concerns, and that's not a good idea usually.

-- 
Gabriel Genellina




More information about the Python-list mailing list