Ismam
1
Is there a Julia equivalent to the below python code which enables Jupyter notebooks to print all outputs.
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
I know I can manually use the display function for each output, but I find that too cumbersome.
Nothing built-in. But you could define something like
_displayall(ex::Expr) = Meta.isexpr(ex, :block) ? Expr(:block, map(_displayall, ex.args)...) : :($(Base.display)($ex))
_displayall(ex::LineNumberNode) = ex
_displayall(ex) = :($(Base.display)($ex))
macro displayall(ex)
:($(esc(_displayall(ex))); nothing)
end
which allows you to do:
@displayall begin
# block of code, display(...) called on the result of each statement
end