0

How can I run python script from JavaScript onclick() function.

function onclick()

Just like the

shell_exec("$command) in php....

threal
  • 1
  • A Python script is ran on server-side. Browser JavaScript is ran on client-side. Your client has to send a request to the server to trigger the evaluation. You can either have a link to an endpoint or send a AJAX request. –  Jun 19 '21 at 11:36
  • There are so many links on Google. If it's not banned in your country, please do a research before asking. [link 1](https://stackoverflow.com/questions/15151133/execute-a-python-script-on-button-click/15151274), [link 2](https://stackoverflow.com/questions/36253135/run-python-script-by-clicking-button-in-javascript) - and so many more... Take a [tour], read [ask] - and next time come with a [mcve] of your issue. – Roko C. Buljan Jun 19 '21 at 11:38

0 Answers0