Skip to content

Instantly share code, notes, and snippets.

@davidbgk davidbgk/
Created Apr 11, 2017

What would you like to do?
An attempt to create the simplest HTTP Hello world in Python3
import http.server
import socketserver
from http import HTTPStatus
class Handler(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
self.wfile.write(b'Hello world')
httpd = socketserver.TCPServer(('', 8000), Handler)
# python3
# - - [11/Apr/2017 11:36:49] "GET / HTTP/1.1" 200 -
# http :8000
HTTP/1.0 200 OK
Date: Tue, 11 Apr 2017 15:36:49 GMT
Server: SimpleHTTP/0.6 Python/3.5.2
Hello world

This comment has been minimized.

Copy link

commented Apr 12, 2017

Python 3.5 seulement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.