ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 29 Jul 2011 08:38:15 -0500Change how sage full_output is displayed?http://ask.sagemath.org/question/8240/change-how-sage-full_output-is-displayed/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,Thu, 21 Jul 2011 10:58:46 -0500http://ask.sagemath.org/question/8240/change-how-sage-full_output-is-displayed/Answer by Mike Hansen for <p>Hi!</p>
<p>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?</p>
<p>Thanks,</p>
http://ask.sagemath.org/question/8240/change-how-sage-full_output-is-displayed/?answer=12529#post-id-12529Right 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.
Thu, 21 Jul 2011 14:51:22 -0500http://ask.sagemath.org/question/8240/change-how-sage-full_output-is-displayed/?answer=12529#post-id-12529Comment by kcrisman for <p>Right now, there's not a way to configure it from the notebook directly, but if you edit the source code in <code>$SAGE_ROOT/devel/sagenb-main/sagenb/notebook/cell.py</code>, you can change the following lines:</p>
<pre><code># 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
</code></pre>
<p>to what you need.</p>
http://ask.sagemath.org/question/8240/change-how-sage-full_output-is-displayed/?comment=21442#post-id-21442Though 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.Fri, 29 Jul 2011 08:38:15 -0500http://ask.sagemath.org/question/8240/change-how-sage-full_output-is-displayed/?comment=21442#post-id-21442Comment by Mike Hansen for <p>Right now, there's not a way to configure it from the notebook directly, but if you edit the source code in <code>$SAGE_ROOT/devel/sagenb-main/sagenb/notebook/cell.py</code>, you can change the following lines:</p>
<pre><code># 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
</code></pre>
<p>to what you need.</p>
http://ask.sagemath.org/question/8240/change-how-sage-full_output-is-displayed/?comment=21452#post-id-21452It doesn't require building Sage. You can just make the change to that file and the restart the notebook server.Thu, 21 Jul 2011 20:12:13 -0500http://ask.sagemath.org/question/8240/change-how-sage-full_output-is-displayed/?comment=21452#post-id-21452Comment by Shashank for <p>Right now, there's not a way to configure it from the notebook directly, but if you edit the source code in <code>$SAGE_ROOT/devel/sagenb-main/sagenb/notebook/cell.py</code>, you can change the following lines:</p>
<pre><code># 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
</code></pre>
<p>to what you need.</p>
http://ask.sagemath.org/question/8240/change-how-sage-full_output-is-displayed/?comment=21454#post-id-21454That requires building sage and that takes a long time. Would it be possible in the future versions to have a variable in the notebook?Thu, 21 Jul 2011 15:21:13 -0500http://ask.sagemath.org/question/8240/change-how-sage-full_output-is-displayed/?comment=21454#post-id-21454