Current location - Quotes Website - Team slogan - How does python build a simple web server?
How does python build a simple web server?
Using Python's own package, you can build a simple web server. Under the path from the CD to the server root directory in DOS, enter the command: \ x0d \ Python-m Web server module[ port number, default 8000]\x0d\ for example: \ x0d \ Python-m simple http server 8080 \ x0d \ and then enter \ x0d \ h TTP:/local HTP in the browser. \x0d\ For example: \ x0d \ http://localhost: 8080/index.htm (of course, you have to create your own index.htm file) \ x0d \ Other machines can also access through the IP address of the server. \x0d\\x0d\ There are three kinds of "Web server modules" here: \x0d\\x0d\BaseHTTPServer: providing basic Web services and processor classes, namely, HTTPServer and BaseHTTPRequestHandler. \x0d\SimpleHTTPServer: contains the SimpleHTTPRequestHandler class that performs GET and HEAD requests. \x0d\CGIHTTPServer: contains classes for processing POST requests and executing CGIHTTPRequestHandler.