What is the Python 3 equivalent of “python -m SimpleHTTPServer”

后端 未结 6 762
萌比男神i
萌比男神i 2020-11-28 00:19

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

6条回答
  •  旧时难觅i
    2020-11-28 00:45

    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
    

提交回复
热议问题