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 will serve the current directory at http://localhost:8000. Quit the server with Command-C.

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/