Source code for csv module

V

vsoler

Hi you all,

I just discovered the csv module here in the comp.lang.python group.

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?

Thanks
 
J

Jon Clements

Hi you all,

I just discovered the csv module here in the comp.lang.python group.

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?

Thanks

The csv module is a wrapper around a C extension. If you're happy
reading C code then downloading the Python sources will let you take a
goosey.

Jon.
 
V

vsoler

The csv module is a wrapper around a C extension. If you're happy
reading C code then downloading the Python sources will let you take a
goosey.

Jon.

I'm still interested in learning python techniques. Are there any
other modules (standard or complementary) that I can use in my
education?
 
T

Tim Chase

I just discovered the csv module here in the comp.lang.python

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:
'/usr/lib/python2.5/csv.pyc'
tchase@asgix2:~$ ls /usr/lib/python2.5/csv.*
/usr/lib/python2.5/csv.py /usr/lib/python2.5/csv.pyc


Same idea in Windows:
'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
 
T

Tim Roberts

vsoler said:
I'm still interested in learning python techniques. Are there any
other modules (standard or complementary) that I can use in my
education?

Are you serious about this? Are you not aware that virtually ALL of the
Python standard modules are written in Python, and are included in their
full, readable source form in every Python installation? \Python25\lib in
Windows, /usr/lib/python25 in Linux.
 
J

Jon Clements

Are you serious about this?  Are you not aware that virtually ALL of the
Python standard modules are written in Python, and are included in their
full, readable source form in every Python installation?  \Python25\lib in
Windows, /usr/lib/python25 in Linux.

Okies, so the sniffer is there as readable python, but the most
interesting bit (which fair enough I made the assumption the OP was
interested in) is the reader/writer functionality -- which is
implemented as a shared library and thus, unless you have a source
install of python somewhere, there is no readable code.

Jon.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top