Wednesday 30 November 2016

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



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


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

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...