There are many projects to import simplejson
modules instead of json
modules
What's the difference between you two?
Why do you import and use such different modules instead of standard library functions?
json
is simplejson
in stdlib.
There's not much difference between the two
Since json
was not added until 2.6,
simplejson
is compatible with other Python versions, so simplejson
is more used
And simplejson
is updated more often.
Personally, when I write a module related to json
,
We recommend that you write json
when you cannot write simplejson
.
When importing, please write as follows.
try: import simplejson as json
except ImportError: import json
© 2024 OneMinuteCode. All rights reserved.