Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have this notebook:

arg1 = "input.txt";
arg2 = "output.txt";
u1 = Import[arg1, "Table"];
u2 = u1(*extremely complicated and long chain of operations*);
Export[arg2, u2]

and I would like to run it in a Python program like this:

def run(arg1,arg2):
    my_mathematica_code(arg1,arg2)

for i in range(100):
    run("input{}".format(i), "output{}".format(i))

How can I do this? Preferably without GUI and several threads in parallel (I can use 4 cores in Mathematica).

share|improve this question
1  
related - if you don't mind putting things into a function: mathematica.stackexchange.com/questions/4643/… – Jonie Aug 20 '13 at 12:08
    
Does this also works for code in my notebook which lies at some arbitrary location on my machine? – Danvil Aug 20 '13 at 12:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.