MiAKD/Lab 1/run.py
nikbel2004@outlook.com a0a3fd0be4 Laboratory_1
2024-09-15 23:43:56 +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()