【笔记】Python通过内置模块启动HTTP服务器
前言
Python通过内置模块,在当前目录下启动HTTP服务器,如果当前目录下有index.html
文件,则会自动渲染index.html
网页,如果当前目录下没有index.html
文件,则会加载当前目录结构
Python2
1 | python2 -m SimpleHTTPServer 80 |
Python3
1 | python3 -m http.server 80 |
Python通过内置模块,在当前目录下启动HTTP服务器,如果当前目录下有index.html
文件,则会自动渲染index.html
网页,如果当前目录下没有index.html
文件,则会加载当前目录结构
1 | python2 -m SimpleHTTPServer 80 |
1 | python3 -m http.server 80 |