On Sat, Dec 27, 2008 at 5:02 AM, Gary M. Josack <g...@byoteki.com> wrote: > 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 >> >> On Sat, Dec 27, 2008 at 4:54 AM, alex goretoy <aleksandr.gore...@gmail.com >> <mailto:aleksandr.gore...@gmail.com>> wrote: >> >> Hello All, >> >> I have this class that I use in one of my projects. I know it's >> missing functionality and some things could have been done >> differently. Can you ehlp me make this class better? What can I do >> to make it more resistant to error? You can find the >> stdout_colours class on Google if you want it, JFGI I want to make >> it more pythonic. I come from a PHP background, can you tell? >> >> Any and all help is appreciated >> -Alex >> >> #!/usr/bin/env python >> from ctypes import * >> import os, sys, types, csv, urllib, urllib2, urlparse, >> string,stdout_colours >> >> class parsercsvy(object): >> """Return a line from a csv file or total amount of lines""" <snip> > Do you know that there is a csv module in the standard library already? > > Thanks, > Gary M. Josack
And here's a link to the docs for the `csv` module: http://docs.python.org/library/csv.html Cheers, Chris -- Follow the path of the Iguana... http://rebertia.com -- http://mail.python.org/mailman/listinfo/python-list