Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: 如何在 Google App Engine 中解析 JSON?
python 2.6 中添加了 json 模块,但 GAE 仅支持 2.5。
我怎样才能在那里使用它?
好吧,您无法使用标准的python库,您将不得不使用一些第三方库,例如
至少 simplejson 适用于 python 2.4
您可以尝试使用yaml模块(包含在 GAE 中)作为 JSON 解析器。最近版本的 YAML 是 JSON 的超集。
yaml
>>> import yaml >>> yaml.load('[false, null, {"x": 1}]') [False, None, {'x': 1}]
您可以尝试使用 django.utils.simplejson