Файл my.py
import http.server
import socketserver
PORT = 9000
class MyHttpRequestHandler(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
self.path = 'index.html'
return http.server.SimpleHTTPRequestHandler.do_GET(self)
Handler = MyHttpRequestHandler
with socketserver.TCPServer(("", PORT), Handler) as httpd:
print("Http Server Serving at port", PORT)
httpd.serve_forever()
Файл my.sh
python my.py
$SHELL
exit 1
Файл index.html
<body>
<h3>Hello!</h3>
</body>