This commit is contained in:
chrosey
2017-09-13 07:52:34 +02:00
parent a1f16c37f4
commit 2340b0226b
24621 changed files with 2912161 additions and 149 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env node
var python = require('../lib/python').shell;
var mycallback = function(err, data) {
if (err) {
console.error(err);
} else {
process.stdout.write(data + '\n>>> ');
}
};
process.stdout.write('Using Python from NodeJS\n>>> ');
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function (chunk) {
python(chunk, mycallback);
});
process.stdin.on('end', function() {
python('quit()');
});