Json_Util.py 401 B

12345678910111213141516171819
  1. import json
  2. def ReadJson(json_file_path, key):
  3. with open(json_file_path, 'r', encoding='UTF-8') as f:
  4. s = json.load(f)
  5. if not key in s:
  6. return None
  7. return s[key]
  8. def getJsonKeys(json_str):
  9. return json_str.keys()
  10. if __name__ == "__main__":
  11. # keystore = ReadJson("/Users/guweibing/921sdk/demo/config.json", "keystore")
  12. # print keystore
  13. pass