I am trying to call brython function from javascript promise it giving error
ReferenceError: brythonListener is not defined how to solve this?
python/brython code
<script type="text/python">
def execute(*args):
print(str(args))
window.brythonListener=execute
</script>
javascript code
function(data){
console.log(data) //till here code works
brythonListener(data)
}
)
what i am missing here?
Reason for the issue
ReferenceError: brythonListener is not definedisbrythonListenerwas created after brython was loaded to solve this just reload brython when the js script calling python scriptBrython script
Js Script which will call brython function