A
A
Alexman140032018-05-14 19:47:24
Python
Alexman14003, 2018-05-14 19:47:24

How to run http server in Python?

Please write step by step how to run http server for CGI scripts. I myself tried to run the code:

from http.server import HTTPServer, CGIHTTPRequestHandler

server_address = ("", 8000)
httpd = HTTPServer(server_address, CGIHTTPRequestHandler)
httpd.serve_forever()

and throws ModuleNotFound error Thanks
in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim Shatalov, 2018-05-24
@netpastor

Judging by the dock http.server appeared from version 3.0
So this error could only be caught on the 2nd version
Check the version of python

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question