I make a connection with DB and select some information with a query in a python file. All information is stored in a variable. Then I start a js, but I want to send this information from python to the js file to use it there. Should I start the script like with some argument and how should I get it in the js file?
1 Answer
Why not create an json file that contain all your data ? Run your python script then update this json and finally call your js file that import this json
With es6 its easy to import a json in a js file :
import * as data from './example.json';
2 Comments
Will Taylor
Sounds a bit messy for this, ie. reading from/writing to the filesystem.
deceze
In keeping with UNIX traditions, the data should (optionally) simply be written to stdout and could be piped into the other program from there.