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
$\endgroup$Print
on the output help? Also, please don't use random tags... this question is not related in anyway to wolfram-alpha-queries or mathematica-education $\endgroup$