You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple way to run Python scripts from Node.js with basic but efficient inter-process communication and better error handling.
5
5
6
6
## Features
@@ -11,17 +11,15 @@ A simple way to run Python scripts from Node.js with basic but efficient inter-p
11
11
+ Simple and efficient data transfers through stdin and stdout streams
12
12
+ Extended stack traces when an error is thrown
13
13
14
+
## Requirements
15
+
First make sure you are able to run `python3` (Mac/Linux) or `python` (Windows) from the terminal. If you are not then you might need to add it to the PATH. If you want to use a version of python not in the PATH you should specify `options.pythonPath`.
16
+
14
17
## Installation
15
18
16
19
```bash
17
20
npm install python-shell
18
21
```
19
22
20
-
To run the tests:
21
-
```bash
22
-
npm test
23
-
```
24
-
25
23
## Documentation
26
24
27
25
### Running python code:
@@ -170,7 +168,7 @@ Creates an instance of `PythonShell` and starts the Python process
170
168
*`parser`: each line of data (ending with "\n") is parsed with this function and its result is emitted as a message
171
169
*`stderrParser`: each line of logs (ending with "\n") is parsed with this function and its result is emitted as a message
172
170
*`encoding`: the text encoding to apply on the child process streams (default: "utf8")
173
-
*`pythonPath`: The path where to locate the "python" executable. Default: "python3" ("py" for Windows)
171
+
*`pythonPath`: The path where to locate the "python" executable. Default: "python3" ("python" for Windows)
174
172
*`pythonOptions`: Array of option switches to pass to "python"
175
173
*`scriptPath`: The default path where to look for scripts. Default is the current working directory.
0 commit comments