0

I have written html code for a text box, when I enter input to html text box, this input should be passed to JavaScript variable. Inside JavaScript I called a python function and this python function should receive the input from html text box input which is passed to JavaScript variable and get executed. Anyone help me with this...

VLAZ
  • 26,331
  • 9
  • 49
  • 67
CoderMJ
  • 17
  • 4
  • How do you call the Python function from JavaScript? – Matthias May 12 '22 at 07:16
  • As a child process const spawner = require('child_process').spawn; const data_to_pass_in=input; console.log('Read input:',data_to_pass_in); const python_process=spawner ('python',['./name.py',input,data_to_pass_in]); – CoderMJ May 12 '22 at 07:25

1 Answers1

0

I found a similar query asked on this platform 9 years ago. Some folks have provided a solution to make an AJAX call to your python code. Please have a look at that thread might be helpful to you in some way. Thank you.

Ahmed Ali
  • 131
  • 3