I have file javascript and python, I want to call javascript function in python code with send variable from python. example my javascript file
var msg = 'this is the encrypt key, very long character';
function split (value, msg){
if(value == msg){
return true;
}else{
return false;
}
}
function process(value){
var a = split(value, msg);
if (a == "true"){
return a;
}else{
return "Error";
}
}
now I want to add this file to my python code, I want to send variable from python to my javascript code. example like this
value = "aaa"
js = open('example.js','r')
print(js.process(value))
I want to import javascript file to python code, and I want to use the process
function in the javascript file. I know my code is wrong, I don't understand how to make a function like that. Please help me