Answer the question
In order to leave comments, you need to log in
What are the options for a beautiful dictionary output to the console?
Does anyone know how to improve console output in pycharm? Now the dictionary is displayed in 1 line, is there an option to display it like a tree? Maybe some kind of plugin or a checkmark in the settings? Or using third-party libraries? Maybe I’m outputting it wrong at all? Now I’m outputting either exit or print
Answer the question
In order to leave comments, you need to log in
1.pprint 2
.
>>> import json
>>> print json.dumps({'a':2, 'b':{'x':3, 'y':{'t1': 4, 't2':5}}},
... sort_keys=True, indent=4)
{
"a": 2,
"b": {
"x": 3,
"y": {
"t1": 4,
"t2": 5
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question