Source code for csv module
Tim Chase
python.list at tim.thechases.com
Mon Feb 2 15:58:15 EST 2009
> I just discovered the csv module here in the comp.lang.python
> group.
It certainly makes life easier.
> I have found its manual, which is publicly available, but
> since I am still a newby, learning techniques, I was wondering
> if the source code for this module is available.
>
> Is it possible to have a look at it?
Yep...the source csv.py is likely already on your computer:
>>> import csv
>>> csv.__file__
'/usr/lib/python2.5/csv.pyc'
tchase at asgix2:~$ ls /usr/lib/python2.5/csv.*
/usr/lib/python2.5/csv.py /usr/lib/python2.5/csv.pyc
Same idea in Windows:
>>> import csv
>>> csv.__file__
'C:\\Program Files\\Python24\\lib\\csv.pyc'
c:\> dir "\Program Files\Python24\lib\csv.*"
...
Just about all the modules in the standard library have python
source in this same directory, so you can spelunk within.
-tkc
More information about the Python-list
mailing list