ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 08 Sep 2019 01:53:38 -0500How to show more results in sagemathcell?https://ask.sagemath.org/question/46676/how-to-show-more-results-in-sagemathcell/If I put following comand in http://sagemath.askplanck.cn/
1+2
10+20
100+200
If Evaluate above command, I can only get last result: 300. What I wish is too get 3 results one by one in **my own sagemath server** , How can I do in configure file.
In https://cocalc.com/, if I put above comand, it shows 3 results. This is nice,and is what I want. Is it possible in such like sagmathcell?
PS. I don't want to put command as following (which can show 3 results):
print 1+2
print 10+20
print 100+200
Thank you very much for your suggestion.
JohnSun, 26 May 2019 07:47:46 -0500https://ask.sagemath.org/question/46676/how-to-show-more-results-in-sagemathcell/Comment by John Bao for <p>If I put following comand in <a href="http://sagemath.askplanck.cn/">http://sagemath.askplanck.cn/</a></p>
<pre><code>1+2
10+20
100+200
</code></pre>
<p>If Evaluate above command, I can only get last result: 300. What I wish is too get 3 results one by one in <strong>my own sagemath server</strong> , How can I do in configure file.</p>
<p>In <a href="https://cocalc.com/">https://cocalc.com/</a>, if I put above comand, it shows 3 results. This is nice,and is what I want. Is it possible in such like sagmathcell?</p>
<p>PS. I don't want to put command as following (which can show 3 results):</p>
<pre><code>print 1+2
print 10+20
print 100+200
</code></pre>
<p>Thank you very much for your suggestion.</p>
<p>John</p>
https://ask.sagemath.org/question/46676/how-to-show-more-results-in-sagemathcell/?comment=47787#post-id-47787Thanks slelievre, is it possible to display full output in sagemathcell (not in Jupyter), not only last result?
@slelievreSun, 08 Sep 2019 01:53:38 -0500https://ask.sagemath.org/question/46676/how-to-show-more-results-in-sagemathcell/?comment=47787#post-id-47787Comment by slelievre for <p>If I put following comand in <a href="http://sagemath.askplanck.cn/">http://sagemath.askplanck.cn/</a></p>
<pre><code>1+2
10+20
100+200
</code></pre>
<p>If Evaluate above command, I can only get last result: 300. What I wish is too get 3 results one by one in <strong>my own sagemath server</strong> , How can I do in configure file.</p>
<p>In <a href="https://cocalc.com/">https://cocalc.com/</a>, if I put above comand, it shows 3 results. This is nice,and is what I want. Is it possible in such like sagmathcell?</p>
<p>PS. I don't want to put command as following (which can show 3 results):</p>
<pre><code>print 1+2
print 10+20
print 100+200
</code></pre>
<p>Thank you very much for your suggestion.</p>
<p>John</p>
https://ask.sagemath.org/question/46676/how-to-show-more-results-in-sagemathcell/?comment=46684#post-id-46684Possibly related:
- [Ask Sage question 46294: REPL-like output](https://ask.sagemath.org/question/46294)
- [Stack Overflow question 36786722: How to display full output in Jupyter, not only last result?](https://stackoverflow.com/q/36786722)Mon, 27 May 2019 04:05:01 -0500https://ask.sagemath.org/question/46676/how-to-show-more-results-in-sagemathcell/?comment=46684#post-id-46684Answer by FrédéricC for <p>If I put following comand in <a href="http://sagemath.askplanck.cn/">http://sagemath.askplanck.cn/</a></p>
<pre><code>1+2
10+20
100+200
</code></pre>
<p>If Evaluate above command, I can only get last result: 300. What I wish is too get 3 results one by one in <strong>my own sagemath server</strong> , How can I do in configure file.</p>
<p>In <a href="https://cocalc.com/">https://cocalc.com/</a>, if I put above comand, it shows 3 results. This is nice,and is what I want. Is it possible in such like sagmathcell?</p>
<p>PS. I don't want to put command as following (which can show 3 results):</p>
<pre><code>print 1+2
print 10+20
print 100+200
</code></pre>
<p>Thank you very much for your suggestion.</p>
<p>John</p>
https://ask.sagemath.org/question/46676/how-to-show-more-results-in-sagemathcell/?answer=46677#post-id-46677Like that:
[1+2, 10+20, 100+200]Sun, 26 May 2019 08:57:34 -0500https://ask.sagemath.org/question/46676/how-to-show-more-results-in-sagemathcell/?answer=46677#post-id-46677Comment by John Bao for <p>Like that:</p>
<pre><code>[1+2, 10+20, 100+200]
</code></pre>
https://ask.sagemath.org/question/46676/how-to-show-more-results-in-sagemathcell/?comment=46704#post-id-46704Thank you very much. I am working of @slelievre 's suggestion.Wed, 29 May 2019 22:33:14 -0500https://ask.sagemath.org/question/46676/how-to-show-more-results-in-sagemathcell/?comment=46704#post-id-46704Comment by Juanjo for <p>Like that:</p>
<pre><code>[1+2, 10+20, 100+200]
</code></pre>
https://ask.sagemath.org/question/46676/how-to-show-more-results-in-sagemathcell/?comment=46686#post-id-46686I don't know if you can configure your SagemathCell server to get what you want. Check the links given by @slelievre below your post. Anyway, you could rely on Python itself, saving results in variables and printing or showing them together at the end, like
a = 1+2
b = 10+20
c = 100+200
# and so on
output = [a,b,c]
print ("{}\n"*len(output)).format(*output)Mon, 27 May 2019 06:04:35 -0500https://ask.sagemath.org/question/46676/how-to-show-more-results-in-sagemathcell/?comment=46686#post-id-46686Comment by John Bao for <p>Like that:</p>
<pre><code>[1+2, 10+20, 100+200]
</code></pre>
https://ask.sagemath.org/question/46676/how-to-show-more-results-in-sagemathcell/?comment=46681#post-id-46681Thank you, FrédéricC and Juanjo. But your answers is not what I want.
I wish the ouput has 3 lines. My example is for simplity, other example cannot be written as an array.
Is there any other suggestion?Sun, 26 May 2019 20:27:09 -0500https://ask.sagemath.org/question/46676/how-to-show-more-results-in-sagemathcell/?comment=46681#post-id-46681Comment by Juanjo for <p>Like that:</p>
<pre><code>[1+2, 10+20, 100+200]
</code></pre>
https://ask.sagemath.org/question/46676/how-to-show-more-results-in-sagemathcell/?comment=46678#post-id-46678Or simply
1+2, 10+20, 100+200
Or even
1+2,\
10+20,\
100+200Sun, 26 May 2019 11:29:14 -0500https://ask.sagemath.org/question/46676/how-to-show-more-results-in-sagemathcell/?comment=46678#post-id-46678