HiveBrain v1.2.0
Get Started
← Back to all entries
patternpythonCritical

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

Submitted by: @import:stackoverflow-api··
0
Viewed 0 times
simplehttpserverpythontheequivalentwhat

Problem

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

Solution

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

Code Snippets

python3 -m http.server

Context

Stack Overflow Q#7943751, score: 2306

Revisions (0)

No revisions yet.