How many of you know Python has a built-in http server?

Oliver Bennet
Oct 3, 2024

--

Python has a built-in HTTP server!

You don’t need to install or configure anything to quickly spin up a simple web server in Python. It comes with a built-in HTTP server, perfect for quick testing or file sharing on your local network.

With just a single command, you can serve files from any directory

python -m http.server

By default, this starts a server on port 8000, and you can access it by visiting http://localhost:8000 in your browser. You can also specify a different port, like this:

python -m http.server 8080

This is a super handy tool for quick file serving, development, or testing static websites without needing complex web server setups!

For More Contents : Graphpe | Oliver

--

--

Oliver Bennet
Oliver Bennet

Written by Oliver Bennet

20 Years of Open-Source Experience. Currently I Write about DevOps, Programming and Linux Technologies.

No responses yet