0
$\begingroup$

Is it possible to print with a carriage return but not a new line? I'd like to keep track of the progress of a long calculation without filling the screen with prints.

$\endgroup$
3
  • 3
    $\begingroup$ I recommend you use Monitor instead. $\endgroup$
    – Szabolcs
    Commented May 20, 2014 at 13:50
  • $\begingroup$ Or if you want use PrintTemporary $\endgroup$ Commented May 20, 2014 at 13:51
  • $\begingroup$ @molekyla777 PrintTemporary will still fill up the screen though, even if the cells are removed when the calculation is done. $\endgroup$
    – Szabolcs
    Commented May 20, 2014 at 13:52

1 Answer 1

0
$\begingroup$

Simplest for me is to use a ProgressIndicator in the interactive notebook: ProgressIndicator[Dynamic[VariableForMapCurrentPosition], {1, LastMapIndex}]

Then have your Map function update 'VariableForMapCurrentPosition' . Two other comments:

  1. As @Szabolcs wrote above, there is more information in previous similar questions.
  2. This doesn't work well with Parallel. You can simply SetShared your position variable, but at least in my case it slows things down -- more than double the time. This post has more on the topic: Monitor doesn't work with ParallelTable
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.