私は辞書のかなりの印刷物を取得しようとしていますが、運がありません:
>>> import pprint
>>> a = {'first': 123, 'second': 456, 'third': {1:1, 2:2}}
>>> pprint.pprint(a)
{'first': 123, 'second': 456, 'third': {1: 1, 2: 2}}
次のように、出力を複数行にしたかったのです。
{'first': 123,
'second': 456,
'third': {1: 1,
2: 2}
}
これはできpprint
ますか?そうでない場合、どのモジュールがそれを行いますか? 私はPython 2.7.3を使用しています。