Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

As answered here, it should be possible to turn off the pretty printing as in IPython, but unfortunately, it does not work in Sage (bug?):

$ sage -ipython
Python 2.7.15 (default, May 20 2018, 23:45:14) 
Type "copyright", "credits" or "license" for more information.

IPython 5.5.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: range(23)
Out[1]: 
[0,
 1,
 2,
 3,
 4,
 5,
 6,
 7,
 8,
 9,
 10,
 11,
 12,
 13,
 14,
 15,
 16,
 17,
 18,
 19,
 20,
 21,
 22]

In [2]: %pprint
Pretty printing has been turned OFF

In [3]: range(23)
Out[3]: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]

As answered here, it should be possible to turn off the pretty printing as in IPython, but unfortunately, it does not work in Sage (bug?):IPython:

$ sage -ipython
Python 2.7.15 (default, May 20 2018, 23:45:14) 
Type "copyright", "credits" or "license" for more information.

IPython 5.5.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: range(23)
Out[1]: 
[0,
 1,
 2,
 3,
 4,
 5,
 6,
 7,
 8,
 9,
 10,
 11,
 12,
 13,
 14,
 15,
 16,
 17,
 18,
 19,
 20,
 21,
 22]

In [2]: %pprint
Pretty printing has been turned OFF

In [3]: range(23)
Out[3]: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]

but unfortunately, it does not work in Sage (bug?)