RUNPY
run any python script directly from node interface
Installation
npm install runpy --save
Usage
var python = require('runpy')
var str = "print 'hello world'"
python.run(str,function(output,data){
if(err){
console.log(error)
}
else{
console.log(output)
}
})
var path = "tmp.py"
python.runFile(path,function(output,error){
if(err){
console.log(error)
}
else{
console.log(output)
}
})
Tests
npm test
Examples
python.run(" any python script ",function(output,error){
console.log(output)
})
python.runFile("path/to/pythonfile",function(output,error){
console.log(output)
})
Contributing
Run any python script directly form node . Run any python file (.py) directly from node easy to handle errors
Requirement
Python installed on the machine
Release History
- 1.0.0 Initial release
- 0.0.9 Run python files