无需安装simplejson的Python 2.5 json [英] Python 2.5 json without installing simplejson

查看:192
本文介绍了无需安装simplejson的Python 2.5 json的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在分布式项目的多个节点上部署一些代码.这些节点上只有Python 2.5,这是一个问题,因为我在json中发送数据(主要是json.loads和json.dumps).出于政策原因,我无法安装新模块或升级python.

我想解决这个问题的一种方法是将json中的字符串手动转换为python对象,反之亦然,但这听起来很痛苦.有没有更简单的方法可以做到这一点?

解决方案

如何手动下载simplejson并将其用作应用程序模块?您可以在此处获取它: https://pypi.python.org/pypi/simplejson

I'm trying to deploy some code on several nodes for a distributed project. These nodes only have Python 2.5 on them, which is a problem because I'm sending data in json (mostly just json.loads and json.dumps). I can't install new modules or upgrade python for policy reasons.

I guess one way to get around this would be to manually convert strings in json to python objects and vice versa, but this sounds painful. Is there an easier way to do this?

解决方案

What about manually downloading simplejson and use it as an application module? You can get it here: https://pypi.python.org/pypi/simplejson

这篇关于无需安装simplejson的Python 2.5 json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆