python-shell icon indicating copy to clipboard operation
python-shell copied to clipboard

How to send .env variables?

Open DaryaTarasowa opened this issue 4 years ago • 1 comments

The Question: How do I send my whole .env file to a python script?

Any relevant python/javascript code: I was trying the following with no success:

let options = {
	args: [req.params.streamId, req.params.term],
	env: process.env
};
PythonShell.run(
	"scripts/associations.py",
	options,
	(err, results) => { ... }
)

DaryaTarasowa avatar Oct 20 '21 10:10 DaryaTarasowa

have you tried passing envs as an extra argument and read it back in using *kwargs ?

dberardo-com avatar Jan 09 '23 18:01 dberardo-com