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?
相关问题
- how to define constructor for Python's new Nam
- Jackson Deserialization not calling deserialize on
- streaming md5sum of contents of a large remote tar
- How to maintain order of key-value in DataFrame sa
- How to get the background from multiple images by
Now, a few years later, simplejson does only support python 2.5+. No more simplejson for systems stuck on 2.4. Even though it is not supported, you may find older packages on pypi. 2.0.9 or 2.1.0 should work.
(I could not comment on the chosen answer, but this just bit me hard, so it may be useful to others as well)
The
json
module in Python 2.6 is mostly the same as thesimplejson
third-party module, which is available for Python 2.4 as well. You can just do:I needed to get this up on an old box with Python 2.4.3. Used simplejson-1.7-py2.4.egg from here:
https://pypi.python.org/packages/2.4/s/simplejson/