Example of Python script usage in Node.js with sync/async output rendering in HTML
Prerequisites
v10
installedv3
available in the PATH
This is a simple example of a Node.js server with following features:
python
script synchronously and returns its outputpython
script asynchronously and send output back in chunkshtml
page with 2 buttons to execute above actions and 2 panes to see preview outputFollowing assumes you have python
v3
installed and have it available in the PATH
:
git clone repository && cd repository_folder
nvm use
- defined in .nvmrc
npm i
npm start
or node server.js