Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
472 B
2
Indexable
Never
import BaseHTTPServer

class HelloHandler(BaseHTTPServer.BaseHTTPRequestHandler):
    def do_GET(self):
        self.send_response(200)
        self.send_header('Content-type', 'text/plain')
        self.end_headers()
        self.wfile.write('Hello, World!')

if __name__ == '__main__':
    server_address = ('', 8000)
    httpd = BaseHTTPServer.HTTPServer(server_address, HelloHandler)
    print('Server running on port 8000...')
    httpd.serve_forever()
Leave a Comment