├── .gitignore ├── script.py ├── index.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json -------------------------------------------------------------------------------- /script.py: -------------------------------------------------------------------------------- 1 | import sys 2 | print("Saindo do forno Python...") 3 | print("Primeiro nome: " + sys.argv[1]) 4 | print("Segundo nome: " + sys.argv[2]) -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | var PythonShell = require('python-shell'); 2 | 3 | var options = { 4 | mode: 'text', 5 | encoding: 'utf8', 6 | pythonOptions: ['-u'], 7 | scriptPath: './', 8 | args: ["Camilla","Martins"] 9 | }; 10 | 11 | var test = new PythonShell('script.py', options); 12 | test.on('message', function(message) { 13 | console.log(message); 14 | }); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pythonbrasilnode1", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node index.js" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "express": "^4.16.4", 14 | "python-shell": "^0.5.0" 15 | } 16 | } 17 | --------------------------------------------------------------------------------