MiAKD/Lab 1/run.py
nikbel2004@outlook.com 86094e3d5a AllLabs
2024-09-15 23:54:00 +04:00

14 lines
411 B
Python

import http.server
import socketserver
PORT = 8000
DIRECTORY = "."
class Handler(http.server.SimpleHTTPRequestHandler):
def __init__(self, *args, **kwargs):
super().__init__(*args, directory=DIRECTORY, **kwargs)
# Запуск сервера на порту 8000
with socketserver.TCPServer(("", PORT), Handler) as httpd:
print(f"Serving at http://localhost:{PORT}")
httpd.serve_forever()