This is an electron app and I am trying to execute one python file that just prints "hello world through javascript. I am getting two errors: error 1: main.js:1 Uncaught ReferenceError: require is not defined
error 2: Uncaught ReferenceError: Cannot access 'PythonShell' before initialization
this is the javascript code:
let {PythonShell} = require('python-shell');
function exec_py(){
console.log("am in");
PythonShell.run("main_script.py", null, function(err,result){
console.log(result)
})
}