width of pretty_print() text output

asked 0 years ago

Max Alekseyev gravatar image

updated 0 years ago

Consider a code example:

sage: L = [Matrix(ZZ,4,4)]*10
sage: pretty_print(L)
[
[0 0 0 0]  [0 0 0 0]  [0 0 0 0]  [0 0 0 0]  [0 0 0 0]  [0 0 0 0]
[0 0 0 0]  [0 0 0 0]  [0 0 0 0]  [0 0 0 0]  [0 0 0 0]  [0 0 0 0]
[0 0 0 0]  [0 0 0 0]  [0 0 0 0]  [0 0 0 0]  [0 0 0 0]  [0 0 0 0]
[0 0 0 0], [0 0 0 0], [0 0 0 0], [0 0 0 0], [0 0 0 0], [0 0 0 0],

[0 0 0 0]  [0 0 0 0]  [0 0 0 0]  [0 0 0 0]
[0 0 0 0]  [0 0 0 0]  [0 0 0 0]  [0 0 0 0]
[0 0 0 0]  [0 0 0 0]  [0 0 0 0]  [0 0 0 0]
[0 0 0 0], [0 0 0 0], [0 0 0 0], [0 0 0 0]
]

It wraps up this list of matrices after 6 in a row, not matter how wide is my terminal window. How I can change this - e.g. specify the window width at which wrap the lines, or turn off wrapping at all?

Preview: (hide)

Comments

2

You may use unicode_art(L)

FrédéricC gravatar imageFrédéricC ( 0 years ago )
2

An alternative is

sage: %display unicode_art
sage: L

To revert to standard display mode, use

sage: %display plain
eric_g gravatar imageeric_g ( 0 years ago )