📜  python代码示例上的服务器

📅  最后修改于: 2022-03-11 14:46:30.226000             🧑  作者: Mango

代码示例1
import http.server
import socketserver

PORT = 8000

Handler = http.server.SimpleHTTPRequestHandler

with socketserver.TCPServer(("", PORT), Handler) as httpd:
    print("serving at port", PORT)
    httpd.serve_forever()