10

As I said in my comments, it is hard to implement this correctly if you aim for some advanced Dynamic features that work in the command line. However, you can surely use the carriage-return trick on the command line. The only obstacle here is that Print puts everything on a new line. However, if you write directly to stdout, you don't have this problem. ...


6

Here is one approach, based on @b3m2a1's excellent answer here: Attributes[StaticMonitor] = {HoldAll}; UpdateMonitor[] := Null; StaticMonitor[expr_, mon_] := Block[ {UpdateMonitor, boxID = ToString@Unique[]}, PrintTemporary[RawBoxes@TagBox[ToBoxes@mon, boxID, BoxID -> boxID]]; UpdateMonitor[] := FrontEndExecute@FrontEnd`BoxReferenceReplace[ ...


6

It is something along those lines: Framed[ DynamicModule[{t = 0} , Overlay[ { Animator[Dynamic@t, AppearanceElements -> None, AnimationRepetitions -> Infinity , AnimationRate -> 1 ] , Rotate[ Dynamic @ RawBoxes @ FEPrivate`ImportImage[ FrontEnd`ToFileName[{"Dialogs", "CloudDialogs"}, "...


6

I have implemented a relatively bare-bones textual frontend for Mathematica called MathLine. It offers Readline-like text input (uses linenoise), which means command history and emacs-style editing. Symbol completion would be easy to implement and is not affected by the same technical challenges of dynamic monitoring mentioned by others. The ergonomic ...


5

As @Kuba mentioned there is a ResourceFunction called ParallelMapMonitored available in the functions repository. Here's an example I concocted that uses it: computethings[x_, y_] := x*y; {ac, bc} = {1, 1}; {acstep, bcstep} = {.005, .005}; ParallelMapMonitored = ResourceFunction["ParallelMapMonitored"]; grid = Table[{x, y}, {x, -ac, ac, acstep}, {y,...


4

n = 1000000; Monitor[table = Table[{i, f[i]}, {i, 1, n, 1}];, i] or, more fancy: Monitor[table = Table[{i, f[i]}, {i, 1, n, 1}];, ProgressIndicator[i, {0, n}]]


3

This solution is specific to Linux k=1; While[ k<100, k++; Pause@.1; (* progress indicator *) Run[ "echo -n '" <> StringRepeat["|",k] <> StringRepeat["-", 100-k] <> "\r'"] ] but you might find a command line that overwrites previous outputs like echo -n ' \r' for ...


3

I tend to use DynamicModule instead of Manipulate Also, just for fun, I decided to overkill this problem to demonstrate how this kind of thing can be done extensibly and flexibly. Options[MySimulation] = { "RangeMin" -> 1, "RangeMax" -> 100, "PointsMin" -> 0, "PointsMax" -> 100000 }; Format[MySimulation[Dynamic[state_Symbol], ...


2

Use table2[ts_] := Module[{\[Theta]S = ts}, Table1 = Monitor[ Table[{\[Theta]S, mS, 10^\[Theta]2, NIntegrate[ Exp[-10^\[Theta]2 \[Theta]S*mS^3*10^2*x], {x, 0, 10000}]}, {mS, 0.03, 2.03, 0.05}, {\[Theta]2, -15., -3., .02}], Row[{ProgressIndicator[mS, {0.03, 2.03}], mS}, " "]]; Flatten[Table1, {2, 1}]] table2[1]


2

As per Szabolcs's suggestion, this can be done by using Set, to dynamically update a variable used by a ProgressIndicator evaluated in Mathematica. See here for a buildable demo. The relevant code (using the variable names used above, which differ from the demo)... MyPackage.m wrapperFunc[] := Monitor[ i=0; myExpensiveFunc[] ProgressIndicator[i] ] ...


2

The folllowing solution is based on some functionalities of https://github.com/Ludwiggle/JWLS_2 In particular, we borrow the webListenerF function, the refresh function and the refresh.wl file from the JWLS_2 project. refresh.wl is a StringTemplate that the refresh function uses to create a dynamic HTML page; such HTML page will serve as our monitor/...


1

You can divide your workload into let's say 20 batches, evaluate your function over each batch in parallel and update the counter in between each batch. With decently sized batches, this will give you roughly the same speed as ParallelTable without any shared variables while also giving you decent enough feedback. flat = Flatten[data, 1]; parts = Partition[...


1

To take some comments and put them into an answer, the reason this happens is auto-compilation. It's been extensively discussed on the site, but basically Mathematica will try to compile any call into Table that's large enough and with a simple enough function directly down to C before evaluating. This means it's impervious to inspection by things like ...


1

It seems that I have an idea. The realization, although stupid, is the following. Table1[m_] := Table[{m, NIntegrate[Exp[-I*m*x], {x, 0, 1000}]}, {i, 0, 80, 1}] M := Association[{1 -> 1, 2 -> 5, 3 -> 0.2, 4 -> 0.08}] Monitor[Table11 = Table[{Table1[M[j]]}, {j, 1, 4, 1}], Row[{ProgressIndicator[j, {1, 4}], j}, " "]] Table2 = Join[Table11[[1]],...


Only top voted, non community-wiki answers of a minimum length are eligible