Background:
Using the settings under Edit-> Preferences->Evaluation I can redirect all the Print statments to the console.
What I'd really like to do is redirect just some specific Print
statements to the console. I know I can print to another notebook with something like:
PrintToNotebook[nb_, expr_] := (
SelectionMove[nb, After, Cell];
NotebookWrite[nb, Cell[BoxData[ToBoxes[expr]], "Print"]])
So perhaps this boils down to finding the "Console Handle"?
Question:
How can I create a function (eg PrintToConsole
) that behaves like Print
but outputs to the console?