How to make Ipython output a list without line breaks after elements?

后端 未结 3 456
孤独总比滥情好
孤独总比滥情好 2020-12-16 11:08

The IPython console prints a list of elements with line breaks so that each element is displayed in its own line. This is usually a feature, but in my case it is a bug: I ne

3条回答
  •  一向
    一向 (楼主)
    2020-12-16 11:38

    An alternative to turning off pretty printing entirely is to increase the max_width trait for the PlainTextFormatter.

    Add the following to ipython_config.py (find it by ipython locate profile):

    c.PlainTextFormatter.max_width = 120
    

    which will allow the pretty printer to use less vertical space by allowing lines to extend out to 120 characters rather than the default of 79.

提交回复
热议问题