How to Easily Start a Web Server with macOS + Python

Tadashi Shigeoka ·  Sat, May 2, 2020

Not just on macOS, but works on any environment with Python installed - I’ll introduce a method for easily starting a web server.

Python

Background: Want to start a web server in the default macOS environment

As of 2020, I believe many engineers doing software development on MacBooks.

So I’ll introduce an example of using Python to start a web server in the default macOS environment.

How to Start a Web Server with Python

For python3

$ python3 --version
Python 3.7.3
python3 -m http.server 8000

For python2

python2 --version
Python 2.7.16
python2 -m SimpleHTTPServer 8000

That’s all from the Gemba, where I wanted to easily start a web server with Python.