What is the Python 3 equivalent of "python -m SimpleHTTPServer"


Question

What is the Python 3 equivalent of python -m SimpleHTTPServer?

1
1063
8/6/2018 9:18:10 AM

Accepted Answer

From the docs:

The SimpleHTTPServer module has been merged into http.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
1527
7/19/2019 7:41:59 AM

The equivalent is:

python3 -m http.server

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon