Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which JSON module can I use in Python 2.5?

Tags:

python

json

I would like to use Python's JSON module. It was only introduced in Python 2.6 and I'm stuck with 2.5 for now. Is the particular JSON module provided with Python 2.6 available as a separate module that can be used with 2.5?

like image 483
moinudin Avatar asked Apr 26 '09 20:04

moinudin


People also ask

Is JSON module inbuilt in Python?

JSON in PythonPython has a built-in package called json , which can be used to work with JSON data.

Is JSON library standard in Python?

JSON is JavaScript Object Notation and it is a data interchange format used widely on the web and elsewhere. The nature of JavaScript is dynamic, and Python works well for parsing and working with JSON. The standard library of Python has a wonderful JSON module that makes working with JSON simple.

What is JSON module in Python?

JavaScript Object Notation (JSON) is a standardized format commonly used to transfer data as text that can be sent over a network. It's used by lots of APIs and Databases, and it's easy for both humans and machines to read. JSON represents objects as name/value pairs, just like a Python dictionary.


1 Answers

You can use simplejson.

As shown by the answer form pkoch you can use the following import statement to get a json library depending on the installed python version:

try:     import json except ImportError:     import simplejson as json  
like image 154
scottynomad Avatar answered Sep 20 '22 20:09

scottynomad