parsing csv files class

alex goretoy aleksandr.goretoy at gmail.com
Sat Dec 27 18:18:37 EST 2008


It's main concern is to grab the file into the buffer for use in other
classes. The self.soc.me_him is just so I know when its ENTERING or EXITING
in that function when I run it in terminal. It's prints it in color. My main
concern right now is to add error handling. I'm still learning how to use
assert and yield, but I got try,except down pat.  All this class does is
grabs the file either from http or local storage into a buffer and I use
that in other classes. I want to add support for creating creating csv as
well. I read the doc on csv and  will try some things out soon. Thanks for
helping me.


On Sat, Dec 27, 2008 at 2:15 PM, Gabriel Genellina
<gagsl-py2 at yahoo.com.ar>wrote:

> 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
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я
а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я



-- 
А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я
а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20081227/cd3ed727/attachment-0001.html>


More information about the Python-list mailing list