“Python Print JSON -Befehlszeile” Code-Antworten

Python Print hübsch JSON


import json

json_data = '[{"ID":10,"Name":"Pankaj","Role":"CEO"},' \
            '{"ID":20,"Name":"David Lee","Role":"Editor"}]'

json_object = json.loads(json_data)

json_formatted_str = json.dumps(json_object, indent=2)

print(json_formatted_str)
Wide-eyed Wren

Python Print JSON -Befehlszeile

# in command line (given python installed)
python -m json.tool my_json.json
Functional Platypus

Ähnliche Antworten wie “Python Print JSON -Befehlszeile”

Fragen ähnlich wie “Python Print JSON -Befehlszeile”

Weitere verwandte Antworten zu “Python Print JSON -Befehlszeile” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen