""" Humanoid-v5 PPO AI Training & 3D Simulation Web Server Serves the web application locally. """ import http.server import socketserver import webbrowser import os import sys PORT = 8080 DIRECTORY = os.path.dirname(os.path.abspath(__file__)) class Handler(http.server.SimpleHTTPRequestHandler): def __init__(self, *args, **kwargs): super().__init__(*args, directory=DIRECTORY, **kwargs) def run(): socketserver.TCPServer.allow_reuse_address = True with socketserver.TCPServer(("", PORT), Handler) as httpd: url = f"http://localhost:{PORT}" print("=" * 65) print(f"๐Ÿš€ Humanoid-v5 PPO 3D Simulation & Visualizer Server is running!") print(f"๐ŸŒ URL: {url}") print("=" * 65) print("Tip: ์›น ๋ธŒ๋ผ์šฐ์ €์—์„œ 'ํ•™์Šต ์‹œ์ž‘'์„ ๋ˆ„๋ฅด๋ฉด 3D ํœด๋จธ๋…ธ์ด๋“œ ์‹œ๋ฎฌ๋ ˆ์ด์…˜๊ณผ") print(" ์‹ค์‹œ๊ฐ„ ๋ณด์ƒ ๊ณก์„ , ์†์‹ค ๊ทธ๋ž˜ํ”„, ๋‰ด๋Ÿด ๋„คํŠธ์›Œํฌ ํ™œ์„ฑํ™”๊ฐ€ ์‹œ๊ฐํ™”๋ฉ๋‹ˆ๋‹ค.") print(" '์••์ถ• ํŒŒ์ผ ์ €์žฅ (ZIP)' ๋ฒ„ํŠผ์œผ๋กœ ํ•™์Šต ๊ฒฐ๊ณผ๋ฅผ ์ฆ‰์‹œ ๋‹ค์šด๋กœ๋“œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.") print("=" * 65) # ์ž๋™์œผ๋กœ ๋ธŒ๋ผ์šฐ์ € ์—ด๊ธฐ ์‹œ๋„ try: webbrowser.open(url) except Exception: pass try: httpd.serve_forever() except KeyboardInterrupt: print("\n์„œ๋ฒ„๊ฐ€ ์ข…๋ฃŒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.") httpd.server_close() if __name__ == "__main__": run()