Set up Python simpleHTTPserver on Windows [duplicate]

别等时光非礼了梦想. 提交于 2019-12-17 05:16:27

问题


I want to set up Python SimpleHTTPServer on Windows XP. I have Python installed on my computer. I am executing the following command:

python -m SimpleHTTPServer 8888

But I am getting the error:

C:\Python33\python.exe: No module named SimpleHTTPServer

Is SimpleHTTPServer for Python available on Windows? If yes, what do I do to set up the server?


回答1:


From Stack Overflow question What is the Python 3 equivalent of "python -m SimpleHTTPServer":

The following works for me:

python -m http.server [<portNo>]

Because I am using Python 3 the module SimpleHTTPServer has been replaced by http.server, at least in Windows.



来源:https://stackoverflow.com/questions/17351016/set-up-python-simplehttpserver-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!