python 3.5 - I get the following error when I try to run a cgi script using webserver: OSError: [WinError 193] %1 is not a valid Win32 application -
here cgi script script attempting run:
print("content-type: text/plain\n") print("hello, world!")
after staring server:
#! python3 import cgitb cgitb.enable() import http.server http.server import httpserver http.server import cgihttprequesthandler def run(server_class=httpserver, handler_class=cgihttprequesthandler): server_address=('',8002) httpd=server_class(server_address, handler_class) httpd.serve_forever() if __name__ == '__main__': run()
not sure if answer correct renamed cgi script in \cgi-bin hello.cgi hello.py , runs correctly no errors. got idea john gaines jr answer post "cgi script not executable".