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
Copy file name to clipboardExpand all lines: README.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,8 +71,11 @@ pyshell.on('message', function (message) {
71
71
});
72
72
73
73
// end the input stream and allow the process to exit
74
-
pyshell.end(function (err) {
74
+
pyshell.end(function (err,code,signal) {
75
75
if (err) throw err;
76
+
console.log('The exit code was: '+ code);
77
+
console.log('The exit signal was: '+ signal);
78
+
console.log('finished');
76
79
console.log('finished');
77
80
});
78
81
```
@@ -209,6 +212,10 @@ Parses incoming data from the Python script written via stdout and emits `messag
209
212
210
213
Closes the stdin stream, allowing the Python script to finish and exit. The optional callback is invoked when the process is terminated.
211
214
215
+
#### `.terminate(signal)`
216
+
217
+
Terminates the python script, the optional end callback is invoked if specified. A kill signal may be provided by `signal`, if `signal` is not specified SIGTERM is sent.
218
+
212
219
#### event: `message`
213
220
214
221
Fires when a chunk of data is parsed from the stdout stream via the `receive` method. If a `parser` method is specified, the result of this function will be the message value. This event is not emitted in binary mode.
0 commit comments