How to configure interaction of HTML+JS with Python?

Good day! Please tell me the following:
There is such problem, a client part on html+css+js are filled with some data and we can pass them on to the server on the server to process and give back to html. Is it possible in Python to do this also, like in PHP, ie send a POST request from the client using JS, get it $_POST in PHP to process and give the JSON back? Is it possible to do so in Python, without any frameworks, only libraries, if so, tell me, please, what and where to look?
July 4th 19 at 23:31
5 answers
July 4th 19 at 23:33
Yes, for parsing POST requests in Python has a cgi module. To encode in json module json.
July 4th 19 at 23:35
To clean - long velosipedit and not the python way

You can read
he just does what parses the incoming request into parts and gives you to bind functions to handle

Those you easier to install flask and write a couple of lines in Python than hands, without the experience of trying to write a copy Ortega
July 4th 19 at 23:37
Read about cgi

Roughly speaking, the mail server can be configured so that it can handlethe execute command and return its result to the client, whether it's php/python/binary file.
For example in apache you add a handler to be able to run scripts in Python, Perl or still a che-thread with the extensions .cgi .py, .pl

Options +ExecCGI
AddHandler cgi-script .cgi .py .pl
July 4th 19 at 23:39
roughly speaking, Python can do everything that PHP can
the question is - why Python PHP if anywhere?
and if not PHP then choose node.ZHS and do everything at ZHS

Python is only required if you're tied to the ready frameworks and libraries written on it
The problem is that is Python - mariano.Miller93 commented on July 4th 19 at 23:42
Don't start holivar - glennie_Mer commented on July 4th 19 at 23:45
: I will continue.
Python is written for larger projects, particularly where you need a high load. Enough ?
P. s: not You - raymundo.Veum commented on July 4th 19 at 23:48
: as far as I know the subject - node copes with high load

I think node is a great choice because:
1) can do more than what you can do with PHP, and not huji ruby or Python zhava
2) do not need to learn an extra language
3) built-in server does not need Apache etc - cale67 commented on July 4th 19 at 23:51
: all bullshit. to explain why I will not. - kavon.Murphy commented on July 4th 19 at 23:54
July 4th 19 at 23:41
Without frameworks (without apache/nginx/cgi/wsgi) using only the built-in module BaseHTTPServer - article on Habr (11 lines of code)

PS Personally, I would recommend microframework bottle or flask

Find more questions by tags HTMLJavaScriptPython