#!/usr/bin/env python3 import http.server import socketserver ADDR = "127.0.0.1" PORT = 8000 Handler = http.server.SimpleHTTPRequestHandler with socketserver.TCPServer((ADDR, PORT), Handler) as httpd: print( "** serving on http://{}:{}/ - press CTRL + C to finish...".format(ADDR, PORT) ) try: httpd.serve_forever() except KeyboardInterrupt: print("\nFinished")