From f2c43929837202ef9f868ba85f43fac4ad7cc5c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Menyh=C3=A9rt=20Heged=C5=B1s?= <30656151+hmenyus@users.noreply.github.com> Date: Mon, 2 Dec 2024 01:08:19 +0100 Subject: [PATCH] Update README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index bf6a437..20fd235 100644 --- a/README.md +++ b/README.md @@ -269,6 +269,13 @@ In this case, one possible order of the execution could look like this (the actu Because jsFunction runs async, it is not possible to pass the result of jsFunction back to Python. But passing arguments from Python to jsFunction is still possible. +### Working with Python multiprocessing +Python uses sys.executable variable when creating new processes. Because the interpreter is embedded into Node, sys.executable points to the Node executable. ***node-calls-python*** automatically overrides this setting in the multiprocessing module to point to the real Python executable. In case it does not work or you want to use a different Python executable, call ***setPythonExecutable(absolute-path-to-your-python-executable)*** before using the multiprocessing module. +```javascript +py.setPythonExecutable(absolute-path-to-your-python-executable); +``` + + ### Doing some ML with Python and Node Let's say you have the following python code in **logreg.py** ```python