1

I have code which uses ExternalEvaluate. Specifically the format using "Command" and "Arguments" where the arguments automatically get converted to python input.

ExternalEvaluate[pythonSession1,<| "Command" -> "pythonCommand", 
                    "Arguments" -> {arg}|> ]

I now need to run this code on a cluster where only version 11.1 is available. Is there any work around to add a custom externalEvaluate that mimics the behavior of ExternalEvaluate.

Kvothe
  • 4,419
  • 9
  • 28
  • I think you will need to do something like this – Jason B. Jun 28 '21 at 15:50
  • I think that just runs a predetermined string in python. I might have to resort to something like this (at that point I think I prefer to just call python from the command line). So it skips the most useful and probably the hardest part of passing the Mathematica arguments to a python function. I would love it if someone knows a way to handle that automatically like ExternalEvaluate does. – Kvothe Jun 28 '21 at 16:10
  • For that matter. I have seen that some people manage to extract Mathematica definitions. Is there any hope of reconstructing ExternalEvaluate by extracting its definitions from a future version and doing a sort of "Future Import"? – Kvothe Jun 28 '21 at 16:11
  • I tried whether I could follow the build in definitions to an argument converting function using https://mathematica.stackexchange.com/a/78898/45020, I think that the thread leading to ExternalEvaluate\Private`normalizeMessage` is the relevant one but I got lost there without finding out how the argument conversion works. – Kvothe Jun 28 '21 at 21:06

0 Answers0