一行Python命令搭建http服务器

---恢复内容开始---

Python 3.0 以上的版本:

python -m http.server 8000
  • 选项-m 表示以脚本模式运行模块
  • 参数 8000 表示服务器端口
  • --bind x.x.x.x 指定绑定的网卡 IP 地址

Python 2.7.x 的版本:

python -m SimpleHTTPServer 8000

 

---恢复内容结束---

posted @ 2018-09-12 15:59  yudis  阅读(1346)  评论(0编辑  收藏  举报