What is the Python 3 equivalent of python -m SimpleHTTPServer
?
SimpleHTTPServer is a python module which allows you to instantly create a web server or serve your files in a snap. Main advantage of python's SimpleHTTPServer is you don't need to install anything since you have python interpreter installed.
The server provides a simple directory UI to access any of the files. This is the simplest way to serve files locally over HTTP directly. Python provides us with the SimpleHTTPServer module (or http. server in Python 3) that can quickly and efficiently serve files from a local directory via HTTP.
From the docs:
The
SimpleHTTPServer
module has been merged intohttp.server
in Python 3.0. The 2to3 tool will automatically adapt imports when converting your sources to 3.0.
So, your command is python -m http.server
, or depending on your installation, it can be:
python3 -m http.server
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With