Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Using with CSV library in Python 2.2!!!

Reply
Thread Tools

Using with CSV library in Python 2.2!!!

 
 
mohan
Guest
Posts: n/a
 
      01-09-2007
Hi Guys,

I'm back one more basic question, this time on using CSV (Comma
Seperated Value) library with Python 2.2. At my workplace I have Python
2.2 installed and am using PythonWin 2.2.1 IDE from Mark Hammond.

I want to use the CSV library module for reading data from the .csv
files and when I try to import the module, I get the error "CSV module
is not found". The reason, CSV module is missing from the Python root
directories. Now my first question is,

1. Does Python 2.2 come with CSV library module or not? If yes, have I
lost it somewhere??

2. If Python 2.2 does not come with CSV module, is it possible to add
the CSV module to the Python root and start working??

3. If yes, where do I get this module from??

Would be glad to have an answer for these questions. Thanks in advance.

Cheers,
Mohan.

 
Reply With Quote
 
 
 
 
skip@pobox.com
Guest
Posts: n/a
 
      01-09-2007

mohan> 1. Does Python 2.2 come with CSV library module or not? If yes,
mohan> have I lost it somewhere??

As the docs for the csv module indicate, it was new in 2.3.

mohan> 2. If Python 2.2 does not come with CSV module, is it possible to
mohan> add the csv module to the Python root and start working??

You might find that it will work with 2.2, though you might have to make
some source code changes to _csv.c to get it to compile.

mohan> 3. If yes, where do I get this module from??

You can get both csv.py and _csv.c via ViewCVS:

http://svn.python.org/view/*checkout...lain&rev=52574
http://svn.python.org/view/*checkout...lain&rev=52574

Skip
 
Reply With Quote
 
 
 
 
mohan
Guest
Posts: n/a
 
      01-09-2007

http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> mohan> 1. Does Python 2.2 come with CSV library module or not? If yes,
> mohan> have I lost it somewhere??
>
> As the docs for the csv module indicate, it was new in 2.3.
>
> mohan> 2. If Python 2.2 does not come with CSV module, is it possible to
> mohan> add the csv module to the Python root and start working??
>
> You might find that it will work with 2.2, though you might have to make
> some source code changes to _csv.c to get it to compile.
>
> mohan> 3. If yes, where do I get this module from??
>
> You can get both csv.py and _csv.c via ViewCVS:
>
> http://svn.python.org/view/*checkout...lain&rev=52574
> http://svn.python.org/view/*checkout...lain&rev=52574
>
> Skip


Hi Skip,

Thanks man. What kind of source code changes should I do to "_csv.c"
file , have you any idea on that too??

Otherwise upgrading to Python 2.4 would be the easiest choice.

Thanks again.

cheers,
Mohan.

 
Reply With Quote
 
skip@pobox.com
Guest
Posts: n/a
 
      01-09-2007

mohan> Thanks man. What kind of source code changes should I do to
mohan> "_csv.c" file , have you any idea on that too??

I've no particular ideas. There are sometimes small C API changes between
feature releases though. If you read through the What's New document for
version 2.3 (google for it) you;ll probably have a pretty good idea of any
such changes.

mohan> Otherwise upgrading to Python 2.4 would be the easiest choice.

Oh, you didn't mention that. By all means, upgrade to 2.4 or 2.5 instead of
trying to backport the csv module to an outdated Python version.

Skip
 
Reply With Quote
 
Larry Bates
Guest
Posts: n/a
 
      01-09-2007
mohan wrote:
> Hi Guys,
>
> I'm back one more basic question, this time on using CSV (Comma
> Seperated Value) library with Python 2.2. At my workplace I have Python
> 2.2 installed and am using PythonWin 2.2.1 IDE from Mark Hammond.
>
> I want to use the CSV library module for reading data from the .csv
> files and when I try to import the module, I get the error "CSV module
> is not found". The reason, CSV module is missing from the Python root
> directories. Now my first question is,
>
> 1. Does Python 2.2 come with CSV library module or not? If yes, have I
> lost it somewhere??
>
> 2. If Python 2.2 does not come with CSV module, is it possible to add
> the CSV module to the Python root and start working??
>
> 3. If yes, where do I get this module from??
>
> Would be glad to have an answer for these questions. Thanks in advance.
>
> Cheers,
> Mohan.
>

Object Craft wrote the csv library that predated the one released in
Python 2.3. You can still get it for earlier Python versions here:

http://www.object-craft.com.au/proje.../download.html

-Larry
 
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 CSV file using csv library Li Chen Ruby 18 03-23-2010 12:44 AM
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



Advertisments