How can I capture output from Print from a function which does not leave the printed object as its final output, (and which I do not wish to edit)? E.g.
Module[{},
Print[Plot[Sin[x], {x, 0, 2 Pi}]];
a = 123]
I would like to use something like a temporary setting for $PrePrint
or $Post
, rather than use cell selection (SelectionMove
, NotebookRead
).
The aim is somehow to intercept the Print
output -- the plot object -- and set it to a variable, (without altering the module).
This attempt did not work:-
Comments
Post a Comment