Ask Your Question

Change how sage full_output is displayed?

asked 2011-07-21 17:58:46 +0200

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 21:51:22 +0200

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 22:21:13 +0200 )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-22 03:12:13 +0200 )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 15:38:15 +0200 )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 17:58:46 +0200

Seen: 456 times

Last updated: Jul 21 '11