Using with CSV library in Python 2.2!!!

Discussion in 'Python' started by mohan, Jan 9, 2007.

  1. mohan

    mohan Guest

    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.
     
    mohan, Jan 9, 2007
    #1
    1. Advertising

  2. mohan

    Guest

    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/*checkou...ules/_csv.c?content-type=text/plain&rev=52574
    http://svn.python.org/view/*checkout*/python/tags/r236/Lib/csv.py?content-type=text/plain&rev=52574

    Skip
     
    , Jan 9, 2007
    #2
    1. Advertising

  3. mohan

    mohan Guest

    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/*checkou...ules/_csv.c?content-type=text/plain&rev=52574
    > http://svn.python.org/view/*checkout*/python/tags/r236/Lib/csv.py?content-type=text/plain&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.
     
    mohan, Jan 9, 2007
    #3
  4. mohan

    Guest

    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
     
    , Jan 9, 2007
    #4
  5. mohan

    Larry Bates Guest

    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/projects/csv/download.html

    -Larry
     
    Larry Bates, Jan 9, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michal Mikolajczyk
    Replies:
    0
    Views:
    673
    Michal Mikolajczyk
    Feb 13, 2004
  2. Skip Montanaro
    Replies:
    0
    Views:
    742
    Skip Montanaro
    Feb 13, 2004
  3. Tintin92
    Replies:
    1
    Views:
    1,753
    Andrew Thompson
    Feb 14, 2007
  4. jliu66
    Replies:
    0
    Views:
    531
    jliu66
    Oct 19, 2007
  5. Li Chen
    Replies:
    18
    Views:
    687
    Azmi Farih
    Mar 23, 2010
Loading...

Share This Page