Skip to content

Commit b1c0885

Browse files
authored
fixed examples for run and runString
1 parent 9ac80a7 commit b1c0885

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ npm test
2828
```typescript
2929
import {PythonShell} from 'python-shell';
3030

31-
PythonShell.runString('x=1+1;print(x)', function (err) {
31+
PythonShell.runString('x=1+1;print(x)', null, function (err) {
3232
if (err) throw err;
3333
console.log('finished');
3434
});
@@ -41,7 +41,7 @@ If the script exits with a non-zero code, an error will be thrown.
4141
```typescript
4242
import {PythonShell} from 'python-shell';
4343

44-
PythonShell.run('my_script.py', function (err) {
44+
PythonShell.run('my_script.py', null, function (err) {
4545
if (err) throw err;
4646
console.log('finished');
4747
});
@@ -206,7 +206,7 @@ Example:
206206

207207
```typescript
208208
// run a simple script
209-
PythonShell.run('script.py', function (err, results) {
209+
PythonShell.run('script.py', null, function (err, results) {
210210
// script finished
211211
});
212212
```
@@ -221,7 +221,7 @@ Example:
221221

222222
```typescript
223223
// run a simple script
224-
PythonShell.run('x=1;print(x)', function (err, results) {
224+
PythonShell.run('x=1;print(x)', null, function (err, results) {
225225
// script finished
226226
});
227227
```

0 commit comments

Comments
 (0)