Created
December 16, 2019 07:31
-
-
Save perXautomatik/7ffc39e5b7b8946db2d21a07fa1fad00 to your computer and use it in GitHub Desktop.
Call Python function from JavaScript code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//@https://stackoverflow.com/questions/13175510/call-python-function-from-javascript-code | |
//All you need is to make an ajax request to your pythoncode. You can do this with jquery http://api.jquery.com/jQuery.ajax/, or use just javascript | |
$.ajax({ | |
type: "POST", | |
url: "~/pythoncode.py", | |
data: { param: text} | |
}).done(function( o ) { | |
// do something | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment