2
是否可以更改IPython使用的漂亮打印機?是否可以更改IPython的漂亮打印機?
我想轉出去pprint++
默認打印機漂亮,這是我喜歡的東西像嵌套結構:
In [42]: {"foo": [{"bar": 42}, {"bar": 16}] * 3, "bar": [1,2,3,4,5]}
Out[42]:
{'bar': [1, 2, 3, 4, 5],
'foo': [{'bar': 42},
{'bar': 16},
{'bar': 42},
{'bar': 16},
{'bar': 42},
{'bar': 16}]}
In [43]: pprintpp.pprint({"foo": [{"bar": 42}, {"bar": 16}] * 5, "bar": [1,2,3,4,5]})
{
'bar': [1, 2, 3, 4, 5],
'foo': [
{'bar': 42},
{'bar': 16},
{'bar': 42},
{'bar': 16},
{'bar': 42},
{'bar': 16},
{'bar': 42},
{'bar': 16},
{'bar': 42},
{'bar': 16},
],
}
還有的是一票打開該功能在這裏:https://github.com/ipython/ipython/issues/9227 –