2
$\begingroup$

It is well known that there are as many output cells as there are rows of input

enter image description here

Is there some way to have only one input, but can give two Output Cells.

For example:

eval["
    1+1
    1+1
"]

gets two output.

Note that excluding the use of CellPrint Output Label, I actually want to know how to trick the front end into multiple input.

related: What is the real default CellEvaluationFunction?

$\endgroup$
1
  • 2
    $\begingroup$ You can have as many CellPrint as you want in your code. Each one will produce a cell which you can make it look like an output cell or whatever you want. But this is technically a side effect, not an output. $\endgroup$ Commented Dec 11, 2019 at 15:03

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.