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 –