Kas*_*sen 2 python simplehttpserver windows-10
我最近买了一台Windows 10机器,现在我想在本地运行一台服务器来测试我正在开发的网页.
在Windows 7上,通过python和命令提示符启动HTTP Server总是非常简单.编写以下代码的Fx将启动HTTP服务器,我可以通过localhost查看该网站.
C:\ pathToIndexfile\python -m SimpleHTTPServer
但这似乎不适用于Windows 10 ...
有谁知道如何在Windows 10上执行此操作?
好的,显然需要不同的命令.
这有效:
C:\ pathToIndexfile\py -m http.server
正如评论中所指出的,对"http.server"的更改不是因为windows,而是因为我从python 2更改为python 3.