The equivalent in Python3 is
python3 -m http.server
But as a warning from https://docs.python.org/3/library/http.server.html#module-http.server
Warning: http.server is not recommended for production. It only
implements basic security checks.
http.server can also be invoked directly using the -m switch of the interpreter.
python -m http.server
The above command will run a server by default on port number 8000.
You can also give the port number explicitly while running the server
python -m http.server 9000
The above command will run an HTTP server on port 9000 instead of 8000.
The option -b/--bind specifies a specific address to which it should bind.
It supports both IPv4 and IPv6 addresses.
For example, the following command binds the server to localhost only:
python -m http.server 8000 --bind 127.0.0.1
python -m http.server 8000 -b 127.0.0.1
By default, the server uses the current directory. The option -d/--directory specifies a directory to which it should serve the files.
Following command shows how to use a specific directory
python -m http.server --directory /tmp/