Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

136
Views
Use Javascript to run another file in directory

is there a way to use javascript to run another file? like lets say i want to run a python file and i want to use javascript to do so like im doing this:

example.js run --> example.py --> example.py(print("Hello World!")

so is this possible or not?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Yes, you could do this with NodeJS and the child_process module.

This would be the JavaScript file:

const { exec } = require("child_process")

exec("python example.py", (error, stdout, stderr) => {
    if (error) {
        console.error(`exec error: ${error}`);
        return;
    }
    console.log(`stdout: ${stdout}`);
    console.error(`stderr: ${stderr}`);
});

Here's the example.py:

print("Hello, world!")

Here's that running on my machine:

enter image description here

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!