Use Python
Hello, i install Python in CPanel:
the passenger_wsgi.py
[CODE=python]
import imp
import os
import sys
sys.path.insert(0, os.path.dirname(__file__))
wsgi = imp.load_source('wsgi', 'python')
application = wsgi.python
I want to create a file test with ajax: [CODE=javascript] $.ajax({ type: 'POST', url: "mysfilepython.py", data: {param: xyz}, //passing some input here dataType: "text", success: function(response){ output = response; alert(output); }}).done(function(data){ console.log(data); alert(data); });
How i can proceed to get this param in python ? Thank you.
I want to create a file test with ajax: [CODE=javascript] $.ajax({ type: 'POST', url: "mysfilepython.py", data: {param: xyz}, //passing some input here dataType: "text", success: function(response){ output = response; alert(output); }}).done(function(data){ console.log(data); alert(data); });
How i can proceed to get this param in python ? Thank you.
-
Hey there! I'm not sure I completely understand the question. Can you let me know what details you're trying to get in Python? 0 -
hello, I am trying to establish a communication of an html form and python, and then python send me back a response. How does python capture the object send by a form post and where to put this python code ? I try this code in file "mysfilepython.py" [CODE=python] import os import sys sys.path.insert(0, os.path.dirname(__file__)) def python(environ, start_response): start_response('200 OK', [('Content-Type', 'text/plain')]) if len(sys.argv) > 1: output = sys.argv[1] else: output = 'no argument found' return output
but I have no answer0 -
Thanks for the additional details. I'm not personally sure, but this might be a better question for a development-specific forum as we primarily deal with the cPanel software here. It's possible another user will share their experience though! 0
Please sign in to leave a comment.
Comments
3 comments