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

253
Views
Try to get many print in nodejs from python script

I'm working on an electron js application which tries to retrieve data from my python script. I managed to retrieve all of my prints in a variable but I can't manage to retrieve them one by one to display them in live on my electron app frame

thanks you very much in advance for your help.

const {PytonShell} - require('python--shell');
let options - {
    pythonOptions: ['u'],
    mode : 'text',
    args: [args]
}

return new Promise((resolve,reject) =>{
  try {
    PythonShell.run('script.py', options, function (err, results) {
    if (err) throw err;
    var results = results.toString()
    if (results.charAt(0) == "0": {
      $('response').append('<div>' + results.slice(1) + '</div>')
    }else if (results.charAt(0) == "1": {
      $('response').append('<div>' + results.slice(1) + '</div>')
    }else if (results.charAt(0) == "2": {
      $('response').append('<div>' + results.slice(1) + '</div>')
    }else{
      console.log(results)
    }
    resolve();
    });
  }
  catch{
    console.log('error running python code')
    reject();
  }
})
about 4 years ago · Juan Pablo Isaza
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!