I would like to run an external code, written in Fortran, C++, or Python, within Wolfram Mathematica 12 on my MAC OS. I looked up on Internet and I tried to read the WSTP documentation on Wolfram Mathematica, but I still was not able to solve my issue. Could you please provide me some examples explained step by step in order that I can understand the strategy and I can then implement to there external codes? Thanks for your help.
Asked
Active
Viewed 198 times
1
1 Answers
0
You must first configure MMA to use Python. Here is how to proceed, from the help (version 12.1):
workflow/ConfigurePythonForExternalEvaluate
If you have done the setup, you can execute Python code inside a Notebook. You may e.g. type ">" (Greater) at the beginning of a line. This gives you a Python code cell, where you can type and execute Python code. E.g.:
Or you may create a Python session, using ExternalEvaluate as described in the help:
ref/ExternalValue
Daniel Huber
- 51,463
- 1
- 23
- 57

ExternalEvaluate. C++ and Fortran will be easiest to do withLibraryLinkunless you need to call into Mathematica from either of them. – b3m2a1 Mar 10 '21 at 18:46