Ask Your Question

Change how sage full_output is displayed?

asked 2011-07-21 10:58:46 -0500

riemann gravatar image


I know if you are doing some calulations for Sage in a browser and if you have a long result, it will truncate the output and shows a link to "full_result.txt". Is there a way to change the threshold such that Sage will truncate the output for (let's say) more than 50 lines?


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2011-07-21 14:51:22 -0500

Mike Hansen gravatar image

Right now, there's not a way to configure it from the notebook directly, but if you edit the source code in $SAGE_ROOT/devel/sagenb-main/sagenb/notebook/, you can change the following lines:

# Maximum number of characters allowed in output.  This is needed
# avoid overloading web browser.  For example, it should be possible
# to gracefully survive:
#    while True:
#       print "hello world"
# On the other hand, we don't want to lose the output of big matrices
# and numbers, so don't make this too small.
MAX_OUTPUT = 32000

to what you need.

edit flag offensive delete link more


That requires building sage and that takes a long time. Would it be possible in the future versions to have a variable in the notebook?

Shashank gravatar imageShashank ( 2011-07-21 15:21:13 -0500 )edit

It doesn't require building Sage. You can just make the change to that file and the restart the notebook server.

Mike Hansen gravatar imageMike Hansen ( 2011-07-21 20:12:13 -0500 )edit

Though it would be nice to have it configurable by a given user on a server, just for their notebook instance... which it probably wouldn't currently be, given that it's in

kcrisman gravatar imagekcrisman ( 2011-07-29 08:38:15 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2011-07-21 10:58:46 -0500

Seen: 289 times

Last updated: Jul 21 '11