Ask Your Question
2

Change how sage full_output is displayed?

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

riemann gravatar image

Hi!

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?

Thanks,

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2011-07-21 21:51:22 +0100

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/cell.py, 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
MAX_OUTPUT_LINES = 120

to what you need.

edit flag offensive delete link more

Comments

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 +0100 )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 +0100 )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 cell.py.

kcrisman gravatar imagekcrisman ( 2011-07-29 15:38:15 +0100 )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

Stats

Asked: 2011-07-21 17:58:46 +0100

Seen: 506 times

Last updated: Jul 21 '11