I'm accustomed to doing import json
in Python 2.6, however I now need to write some code for Python 2.4. Is there a JSON library with a similar interface that is available for Python 2.4?
views:
97answers:
1
+2
A:
The json
module in Python 2.6 is mostly the same as the simplejson
third-party module, which is available for Python 2.4 as well. You can just do:
try:
import json
except ImportError:
import simplejson as json
Thomas Wouters
2010-07-20 15:59:36
Perfect, many thanks.
kdt
2010-07-20 17:04:09