Hi Everyone,

I want to execute a python script which contains some shell commands, by 
clicking an HTML button in Angular Js UI. So far I've done this,
```
 <input type="button" id='script' name="scriptbutton" value=" Run Script " 
onclick="goPython()">

 <script src="http://code.jquery.com/jquery-3.3.1.min.js"; 
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" 
crossorigin="anonymous"></script>
    <script>
        function goPython(){
            $.ajax({
              type: 'GET',    
              url: 'script.py',
      success: function(data){
       alert(data);
      console.log('success',data);
 });
   </script>
```
However, i nthe console I only get the contents of the script, the script 
itself doesn't  get executed. I googled and found that I need to make an 
$http to my python script and set up a listener in that script as well. But 
I don't know how to achieve that. Can you guys help me what I need to do to 
execute the python script by clicking the button.

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/a2a4c7fd-85c2-4cda-8afb-c9cd00ad19c1%40googlegroups.com.

Reply via email to