I have a Python program which will run a script in the Wolfram language and then return to the main program. Is it possible to return values/variables to the main program?
This is the code in Python running the Wolfram language code:
os.system('wolfram -script file.wl')
Then in file.wl, for example, I can run a command such as 1+1, which will give me an output of 2.
Can I then use this value 2 in the rest of my Python program?
e.g. print (ans)
ToExpression– s0rce Dec 29 '13 at 01:10Printon the output help? Also, please don't use random tags... this question is not related in anyway to [tag:wolfram-alpha-queries] or [tag:mathematica-education] – rm -rf Dec 29 '13 at 01:20