Ask Your Question

How to show more results in sagemathcell?

asked 2019-05-26 07:47:46 -0500

John Bao gravatar image

updated 2019-05-26 20:31:16 -0500

If I put following comand in


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, 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.


edit retag flag offensive close merge delete


Thanks slelievre, is it possible to display full output in sagemathcell (not in Jupyter), not only last result? @slelievre

John Bao gravatar imageJohn Bao ( 2019-09-08 01:53:38 -0500 )edit

1 answer

Sort by » oldest newest most voted

answered 2019-05-26 08:57:34 -0500

FrédéricC gravatar image

Like that:

[1+2, 10+20, 100+200]
edit flag offensive delete link more


Or simply

1+2, 10+20, 100+200

Or even

Juanjo gravatar imageJuanjo ( 2019-05-26 11:29:14 -0500 )edit

Thank 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?

John Bao gravatar imageJohn Bao ( 2019-05-26 20:27:09 -0500 )edit

I 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)
Juanjo gravatar imageJuanjo ( 2019-05-27 06:04:35 -0500 )edit

Thank you very much. I am working of @slelievre 's suggestion.

John Bao gravatar imageJohn Bao ( 2019-05-29 22:33:14 -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

1 follower


Asked: 2019-05-26 07:47:46 -0500

Seen: 180 times

Last updated: May 26 '19