Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Source code for csv module

Reply
Thread Tools

Source code for csv module

 
 
vsoler
Guest
Posts: n/a
 
      02-02-2009
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
 
Reply With Quote
 
 
 
 
Jon Clements
Guest
Posts: n/a
 
      02-02-2009
On 2 Feb, 20:46, vsoler <(E-Mail Removed)> wrote:
> 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.
 
Reply With Quote
 
 
 
 
vsoler
Guest
Posts: n/a
 
      02-02-2009
On 2 feb, 21:51, Jon Clements <(E-Mail Removed)> wrote:
> On 2 Feb, 20:46, vsoler <(E-Mail Removed)> wrote:
>
> > 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.


I'm still interested in learning python techniques. Are there any
other modules (standard or complementary) that I can use in my
education?
 
Reply With Quote
 
Tim Chase
Guest
Posts: n/a
 
      02-02-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@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





 
Reply With Quote
 
Tim Roberts
Guest
Posts: n/a
 
      02-03-2009
vsoler <(E-Mail Removed)> wrote:
>
>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.
--
Tim Roberts, http://www.velocityreviews.com/forums/(E-Mail Removed)
Providenza & Boekelheide, Inc.
 
Reply With Quote
 
Jon Clements
Guest
Posts: n/a
 
      02-03-2009
On 3 Feb, 04:27, Tim Roberts <(E-Mail Removed)> wrote:
> vsoler <(E-Mail Removed)> wrote:
>
> >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.
> --
> Tim Roberts, (E-Mail Removed)
> Providenza & Boekelheide, Inc.


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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
read and write csv file using csv module jliu66 Python 0 10-19-2007 03:12 PM
How to move data from a CSV file to a JTable, and from a JTable to a CSV file ? Tintin92 Java 1 02-14-2007 06:51 PM
Re: csv writerow creates double spaced excel csv files Skip Montanaro Python 0 02-13-2004 08:50 PM
csv writerow creates double spaced excel csv files Michal Mikolajczyk Python 0 02-13-2004 08:38 PM
Python-2.3b1 bugs on Windows2000 with: the new csv module, stringreplace, and the re module Daniel Ortmann Python 4 07-02-2003 03:23 PM



Advertisments