Study Guides | | Local Web server with Python

Study Guide: Local Web server with Python

Python has an HTTP server built into the Standard Library that can be used to preview websites from a local directory.

The following commands will serve the current directory at http://localhost:8000.

Quit the server by entering Command-C.
(Hold down the Command key and press the C key.)

Python 3.x

$ python3 -m http.server

Python 2.x

$ python -m SimpleHTTPServer 8000
Source: https://class.ronliskey.com/study/computing/python-local-web-server/