From 1cb2b7e57c66da0e2aec204d50841d2803c2360c Mon Sep 17 00:00:00 2001 From: ChenKaiLiuG <141424456+ChenKaiLiuG@users.noreply.github.com> Date: Mon, 14 Apr 2025 11:28:51 +0800 Subject: [PATCH] Delete runprint4html.py --- run/runprint4html.py | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 run/runprint4html.py diff --git a/run/runprint4html.py b/run/runprint4html.py deleted file mode 100644 index 79d1633..0000000 --- a/run/runprint4html.py +++ /dev/null @@ -1,27 +0,0 @@ -from http.server import SimpleHTTPRequestHandler, HTTPServer -import os - -class MyHandler(SimpleHTTPRequestHandler): - def do_GET(self): - if self.path == '/get_file_content': - filename = '找找自己問題.txt' - if os.path.exists(filename): - with open(filename, 'r', encoding='utf-8') as f: - content = f.read() - self.send_response(200) - self.send_header('Content-type', 'text/plain; charset=utf-8') - self.end_headers() - self.wfile.write(content.encode('utf-8')) - else: - self.send_response(404) - self.send_header('Content-type', 'text/plain; charset=utf-8') - self.end_headers() - self.wfile.write(b'File not found.') - else: - super().do_GET() - -if __name__ == '__main__': - port = 8000 - httpd = HTTPServer(('localhost', port), MyHandler) - print(f"Serving on port {port}") - httpd.serve_forever()