html tool

2020年5月21日星期四

python 中使用jq

参考:https://pypi.org/project/jq/

setup
pip install jq

 
code

1 #-*-coding:utf8-*-
  2 import jq, re
  3 import json
  4  
  5 a = {"t":{"t1":"a","a":"b"}, "e":"e1"}
  6 print jq.compile(".t.a").input(a).first() 
  7 assert jq.compile(".").input("hello").first() == "hello"



没有评论:

发表评论