Guest User

Untitled

a guest
Dec 11th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. session = StartExternalSession["Python-NumPy"];
  2. ExternalEvaluate[session, "def double(x):
  3. return x*2"];
  4. doublePython[arg_] := ExternalEvaluate[session, "double(" <> ToString[arg] <> ")"]
  5.  
  6. Do[Pause[1]; Print[doublePython[i]], {i, Range[4]}] // AbsoluteTiming
  7. ParallelDo[Pause[1]; Print[doublePython[i]], {i, Range[4]}] // AbsoluteTiming
Add Comment
Please, Sign In to add comment