1

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?

2
  • you might want to read about web frameworks like flask. Commented Jun 26, 2019 at 13:00
  • 4
    What exactly does that mean, "start a js"…? Commented Jun 26, 2019 at 13:10

1 Answer 1

0

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';
Sign up to request clarification or add additional context in comments.

2 Comments

Sounds a bit messy for this, ie. reading from/writing to the filesystem.
In keeping with UNIX traditions, the data should (optionally) simply be written to stdout and could be piped into the other program from there.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.