A bin folder, holding helpfull scripts and commands
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1234567891011121314151617
  1. #!/usr/bin/python3
  2. #
  3. import sys
  4. import json
  5. output = []
  6. with open(sys.argv[1], 'r') as rh:
  7. i = 1
  8. for line in rh.readlines():
  9. try:
  10. data = json.loads(line)
  11. except json.decoder.JSONDecodeError as e:
  12. print("ERROR in Line %d" % i)
  13. raise
  14. output.append(json.loads(line))
  15. i += 1
  16. print(json.dumps(output, indent=4))