一个为Python服务的JSon Helper

jthon的Python项目详细描述


JTHON

json,但使用lisp。这是一个使处理json文件更容易的实用程序。

安装

pip安装jthon

使用量

importjthona_new_dict={'fruits':{'pineapple':0,'apples':2,'orange':4,'pears':1}}example=jthon.load('fruits',a_new_dict)find=example.find(key='apple',exact=False)forfoundinfind:print("I've found '{}', with a value of '{}'.".format(found.key,found.value))print("{}".format(found.siblings))print("There are {} oranges in the dict!".format(example.get('fruits').get('orange')))example['fruits']['peach']=1example.save()print(example)

更多示例可在examples文件夹中找到

要求

python3 >

作者

许可证

此项目在麻省理工学院授权-有关详细信息,请参见LICENSE文件

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java无法启动应用程序:JNLP错误   java根据用户输入在PreparedStatement中使用setTime()或setNull()   java EJB与同步   java以object为键通过hashmap进行搜索   java中的模10^9+7   针对包含其他对象的对象的java OOP最佳实践   如何将字符串作为HTML代码从Java文件读取到JSP页面?   java我的POM怎么了?“解析表达式..检测到递归表达式循环”   用于Hbase的Mapreduce的java NoSuchMethodError   JAVAlang.SecurityException:权限拒绝:启动意图{act=安卓.Intent.action.MAIN cat=[安卓.Intent.category.LAUNCHER]   数组初始化谜语Java   通过arraylist搜索时的java句柄关联