# -*- coding: utf-8 -*-
import http.server
import socketserver
import socket
PORT = 8000
Handler = http.server.SimpleHTTPRequestHandler
with socketserver.TCPServer(("", PORT), Handler) as httpd:
hostname = socket.gethostname()
ip_address = socket.gethostbyname(hostname)
print(f"IP_Address: {ip_address}")
print("serving at port", PORT)
httpd.serve_forever()
04-10
162
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
04-08
116
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)