Computer Science, asked by AbhishekRajput8489, 1 year ago

How we can use Python CGI along with AJAX in Javascript?

Answers

Answered by viveksoni1550
0

If I can how do the python script work, exactly the same as when serving a page using CGI?

This doesn't work:

import cgitb; cgitb.enable()

import cgi

import os

print "Content-Type: text/html\n"

input_data = cgi.FieldStorage()

print "hello"

When I click my button in my page, nothing happens & my CGI server (which works fine for cgi page requests) gives me a http 501 error.

My html & javascript:

Similar questions