stdio via http
node -v # works with Node.js
npm i --save
export PATH=$PWD/bin:$PATH
htty --help
Usage: index.js [--port <port>] command...
Options:
--help Show help [boolean]
--version Show version number [boolean]
--port, -P [number] [default: 8080]
htty ipython --colors=NoColor
Listen on 8080
Python 3.7.1 (default, Dec 14 2018, 13:28:58)
...
In [1]:
htty-send <<< '(1, 2, 3)'
Out[1]: (1, 2, 3)
In [2]:
The server listens /
via POST.
curl localhost:8080 -H 'Content-Type: application/octet-stream' --data 'import random; random.random()'
Out[2]: 0.5662312022239704
In [3]:
nnoremap X V:w !htty-send<cr>
vnoremap X :w !htty-send<cr>
Press X
, then the cursor line code, or selected lines will be executed.
(NOTE to PATH.)