美文网首页
Python开启web服务

Python开启web服务

作者: 李小西033 | 来源:发表于2017-11-29 16:54 被阅读43次

Python2

# 指定端口号
python -m SimpleHTTPServer 8000

Python3之后 SimpleHTTPServer模块被合并进了http.server,开启web服务命令变更为:

python -m http.server 8000

也可以绑定IP

python -m http.server 8000 --bind 127.0.0.1

https://docs.python.org/2/library/simplehttpserver.html
https://docs.python.org/3.6/library/http.server.html

相关文章

  • Python开启web服务

    Python2 Python3之后 SimpleHTTPServer模块被合并进了http.server,开启we...

  • mac 实用Terminal脚本命令

    (不定期更新) python 快速开启临时简易服务器 应用场景:临时快速开启本地 web 服务,访问静态资源;内网...

  • 1. Flask基础知识

    1. Flask的web服务器 1)WSGI Python Web服务器网关接口(Python Web Serve...

  • python -m 命令

    python 2 开启http服务 python3 开启http服务 序列化json

  • 1.9.4 管理站点

    服务器 运行如下命令可以开启服务器 可以不写ip,默认端口为8000 这是一个纯python编写的轻量级web服务...

  • 一些常识

    1.Python Web服务器网关接口(Python Web Server Gateway Interface,简...

  • WSGI

    简介 Web服务器网关接口(WSGI)是用于Python编程语言的Web服务器(Web Server)和Web应用...

  • Python Web编程

    本文翻译自HOWTO Use Python in the web 摘要 本文提供了一些集成Python和Web服务...

  • Mac上Python Web的部署:Nginx+Gunicorn

    为什么生产上不使用Web框架自带的服务 Python有内置的WSGI服务器,用来做Python Web开发的框架,...

  • werkzeug: 使用笔记(一)

    WSGI WSGI,Python Web Server Gate Interface, Python 服务器网关接...

网友评论

      本文标题:Python开启web服务

      本文链接:https://www.haomeiwen.com/subject/nbhpbxtx.html