From Python to Mathematica and back again
On way to do this:
- Put your Mathematica code into a plain text file for example
make_arr.m
- Use command line interface of Mathematica:
math -script make_arr.m
- From python invoke the above with the
subprocess
modulesubprocess.call(["math", "-script", "make_arr.m"])
Optionally you can use command line arguments in the Mathematica script:
file_name = $CommandLine[[4]]