From 5942fe3a5b835065056f623fd7802e0e30c4073d Mon Sep 17 00:00:00 2001 From: frozar Date: Thu, 21 Mar 2019 11:53:43 +0100 Subject: [PATCH] [SCRIPT] serve.py: display the address of the URL used by the server (copy/paste). --- serve.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serve.py b/serve.py index adffe91..3dd9ef7 100644 --- a/serve.py +++ b/serve.py @@ -27,15 +27,15 @@ handler.extensions_map.update({ }) socketserver.TCPServer.allow_reuse_address = True +print("Serving at port", PORT) +print("View at: http://localhost:{}/".format(PORT)) # The context manager protocol is support only since python 3.6 and higher. if (3 <= sys.version_info[0]) and (6 <= sys.version_info[1]): with socketserver.TCPServer(("", PORT), handler) as httpd: httpd.allow_reuse_address = True - print("Serving at port", PORT) httpd.serve_forever() else: httpd = socketserver.TCPServer(("", PORT), handler) httpd.allow_reuse_address = True - print("Serving at port", PORT) httpd.serve_forever() httpd.serve_close()