How to silent/quiet HTTPServer and BasicHTTPRequestHandler's stderr output?
问题 I am writing a simple http server as part of my project. Below is a skeleton of my script: from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler class MyHanlder(BaseHTTPRequestHandler): def do_GET(self): self.send_response(200) self.send_header('Content-type', 'text/html') self.end_headers() self.wfile.write('<html><body><p>OK</p></body></html>') httpd = HTTPServer(('', 8001), MyHanlder) httpd.serve_forever() My question: how do I suppress the stderr log output my script produces