csv from python2.3 for python2.2
how to get the csv of 2.3 to work in 2.2
csv is a separate module in 2.2, but becomes a built-in module for 2.3. But csv of 2.2 missed lots of functions i.e. reader, writer..., almost totally different from 2.3.
Luckily _csv.c from python 2.3 is backward compatible to python2.2.
- get python2.3 source code from python.org
- get _csv.c and csv.py by 'find ./ -name csv' within python2.3 source code directory
- 'gcc -O2 -fPIC -I/usr/include/python2.2 -c ./Modules/_csv.c -o _csv.o'
- 'gcc -O2 -shared -fPIC _csv.o -o _csv.so'
- copy _csv.so and csv.py to a directory exported in PYTHONPATH