Contents

Python-标准库-http.server

Contents

python官网标准库参考

python官网标准库详细文档索引

python官网语言参考文档

该库用于快速构建一个静态服务器,如果在静态服务器根目录有index.html则直接返回index.html

-d选项配置根目录位置,不配置则为命令行的当前位置

1
python -m http.server 端口号

当你的python3提示没有这个库时,使用如下命令

1
python -m SimpleHTTPServer 端口号

因为这个库是从SimpleHTTPServer改名过来的,可能你的python版本比较低,python2中使用 SimpleHTTPServer ,python3中使用 http.server

Python 3.0 有什么新变化

 |