node.js

How can I POST a JSON to an Express server with python module "requests"?

How can I POST a JSON to an Express server with python module "requests"? Question: So, I’m trying to post a JSON to a Node.JS server running Express with Python using the "requests" module. I’ve made a lot of tries, all of them failed. Closest I got was this: Server code: const fs = require(‘fs’); …

Total answers: 2

POST request from python to nodeJS server

POST request from python to nodeJS server Question: I am trying to send a post request from python to my nodeJS server. I can successfully do it from client-side js to nodeJS server using the fetch API but how can I achieve this with python? What I tried below is sending the post request successfully …

Total answers: 2

Execute javascript code in nodejs using spawn

Execute javascript code in nodejs using spawn Question: I wrote below code in node js to execute python code and print logs and return output using spawn, const { spawn } = require(‘node:child_process’); const ls = spawn(‘node’, [‘-c’, "python code content will come here"]); ls.stdout.on(‘data’, (data) => { console.log(`stdout: ${data}`); }); it works fine, but …

Total answers: 1

error while parsing JSON file, probally a hidden value on the JSON content

error while parsing JSON file, probally a hidden value on the JSON content Question: I have this JSON file: https://drive.google.com/file/d/1zh_fJJNWs9GaPnlLZ459twSubsYkzMi5/view?usp=share_link Looks normal at first, even using online json schema validators However when parsing it locally, I get error. I tried it with python, nodejs and golang but It’s not working. I think it probably has …

Total answers: 1

Can't resolve 'child_process'

Can't resolve 'child_process' Question: I am currently on the backend of my software which runs via electron but I can’t get the data. So I tried to retrieve the data from a python program that sends it using Flask, but when I run the npm start command it gives me the following error message: Module …

Total answers: 2

How to convert received data Array in Buffer type after python flush the stdout to nodejs

How to convert received data Array in Buffer type after python flush the stdout to nodejs Question: I have a nodejs backend called a python script and then used stdout.flush to send the json to nodejs backend. at the end of the python script: sys.stdout.write(json.dumps(json_dict)) sys.stdout.flush() on nodejs backend: app.get(‘/records’, (req, res) => { const …

Total answers: 1

Exchanging data between Python Telethon library and Node.js

Exchanging data between Python Telethon library and Node.js Question: I faced such a problem: in my small test app I have simple node.js (express) server and python script, which allows me to interact with Telegram API using Telethon library. In my scenario I have to provide my python script a phone number and a password. …

Total answers: 1

How can I convert CSV to JSON with data type in python or node.js?

How can I convert CSV to JSON with data type in python or node.js? Question: I wanna convert CSV to JSON correct data type csv file 2nd row is data type. data has over 300 properties example data: Name DMG HP Human string number number boolean knight 100 500 true archer 50 200 true dog …

Total answers: 2

Running a python file on the button click in Node JS

Running a python file on the button click in Node JS Question: I am trying to run a python file (which is actually running a Deep learning model) on a button click using Node JS. I am trying to achieve this using input form in html and routes in index.js file. But this is causing …

Total answers: 1