Source code for csv module

Tim Chase python.list at
Mon Feb 2 21:58:15 CET 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 is likely already on your computer:

   >>> import csv
   >>> csv.__file__
   tchase at asgix2:~$ ls /usr/lib/python2.5/csv.*
   /usr/lib/python2.5/  /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.


More information about the Python-list mailing list