I am trying to setup a web interface to a couple of Mathematica scripts, which in itself is quite simple:

$script = "myScript.wls";
echo shell_exec('wolframscript -print all -format List -file '.$script);

However, how can I make Mathematica execute the script in an already running local kernel, so that it doesn't go through the overhead of spawning a bunch of new ones every time (which ends up being a rather significant part of the HTTP request time)?

I tried doing this: Opening a notebook from command line in an existing front end instance
That's not the answer.

  • $\begingroup$ You could launch an HTTP server and then communicate with it, as shown here. $\endgroup$
    – C. E.
    Oct 1, 2018 at 6:51


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.