Group Abstract Group Abstract

Message Boards Message Boards

0
|
10K Views
|
3 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Running notebook with inputs from other Mathematica and MX files

Posted 5 years ago
POSTED BY: S G
3 Replies
Posted 5 years ago

Crossposted here.

POSTED BY: Rohit Namjoshi
Posted 5 years ago

Hi Kyle,

you want a notebook to script converter like jupyter has... yeah

Mark the cells in the notebook that you want to be exported as initialization cells. Then, "File / Save As" and select Format = "Wolfram Language Script"

POSTED BY: Rohit Namjoshi

Do you want to directly run your notebook? A "wolfram file" is ambiguous. You could set some global variables to change parameters and then iterate over NotebookEvaluate@NotebookObject[] where the object is found by running EvaluationNotebook[] in the notebook you want to run or by pointing at the file path. of the notebook you want to run many times. You could also save your notebook as a .wl script which you can run with commend line arguments. Or what I usually do when I have a notebook full of good cells is that I will move all the code into a big function definition so I can iterate over it. Or define each cell as a setdelayed variable by placing varName:= in the front. Honestly this refactoring process is a bit laborious. Ha, you know what the issue is, you want a notebook to script converter like jupyter has... yeah... Or you could also do some crazy madness using TemplateNotebook@NotebookRead@InputNotebook[] lol madness

POSTED BY: Kyle Keane
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard