#running python in node.js

66 messages · Page 1 of 1 (latest)

buoyant obsidian
#
function runpy(username){
var dataToSend;
 const python = spawn('python', ['verify.py']);
 python.stdout.on('data', function (data) {
  dataToSend = data.toString();
console.log(dataToSend)
 });
 python.on('close', (code) => {
 console.log(dataToSend)
})};
runpy()
jade crownBOT
#
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
buoyant obsidian
subtle bay
#

what's spawn from? child_process?

#

looks like that env doesn't have a python binary.

buoyant obsidian
subtle bay
#

i know what child_process is, im asking to confirm that's how you've defined it

buoyant obsidian
#

that's how

#

._.

subtle bay
#

sidenote; you can't run python in node.js without a interpreter for python, child_process lets you run python from nodejs
they're still kinda separate

subtle bay
subtle bay
#

"entry" here refers to something in a directory (folder)

buoyant obsidian
#

so like no such file exists?

subtle bay
#

so basically there's no binary called python, or at least the shell didn't find one

subtle bay
buoyant obsidian
#

-.-

subtle bay
#

doing fs.readFile or whatever on a non-existant file will give the same error

subtle bay
buoyant obsidian
subtle bay
#

the python interpreter is missing

#

python itself is the missing thing

buoyant obsidian
#

@subtle bay ._.

subtle bay
#

????

buoyant obsidian
#

huh

#

so I have to download python? tf

#

.______.

subtle bay
#

isn't that replit

buoyant obsidian
#

@subtle bay it is

subtle bay
#

you don't need to ping me, im right here

buoyant obsidian
#

._. ok

subtle bay
#

anyways yeah i wouldn't recommend trying to access other executables (or at least, expecting that to be reliable) on an environment you don't/can't control

buoyant obsidian
subtle bay
#

you could try some other calls to probe what the environment does have, but the environment can change at any time so don't expect it to be reliable

subtle bay
#

you can know and modify the environment locally.

buoyant obsidian
#

and I don't have a server to do so

#

or a domain ._.

subtle bay
#

so you want this to be on 24/7?

buoyant obsidian
subtle bay
#

im not so sure instagram is going to like that

buoyant obsidian
#

bruh it's just accepting insta follow requests

#

._.

subtle bay
#

that's not the problem

buoyant obsidian
#

what is?

subtle bay
#

the (potential) problem is it being on perpetually

subtle bay
#

a bot that's always on and accessing private instagram apis

#

does that not sound at least somewhat questionable

buoyant obsidian
subtle bay
#

they don't really need to

buoyant obsidian
#

.-.

#

bruh my little brain is getting smoooooshhheeeed

subtle bay
#

please be considerate of other services when making your projects

anything else i can tell you, i've already said

buoyant obsidian
subtle bay
#

you can run python on replit, but i guess not from the environment configured for js

#

or at least, not under python

edgy shadow
buoyant obsidian
#

may i have a command line cuz I only installed packages never anything else beyond that

subtle bay