python开启http服务
2018-09-17 14:14
429 查看
官方文档例子。
直接用命令行也可以:
如图,如果里面有index.html,会直接显示index.html页面
import http.server import socketserver port=8000 handl=http.server.SimpleHTTPRequestHandler with socketserver.TCPServer(('127.0.0.1',port),handl) as httpd: print('sering st port',port) httpd.serve_forever()
直接用命令行也可以:
pyhon -m http.server 8000 --bind 127.0.0.1
如图,如果里面有index.html,会直接显示index.html页面
相关文章推荐
- SimpleHTTPServer python 开启简单的http服务
- Python 一条命令 开启 Http 服务
- Python 开启简单http服务命令
- 访问python服务 http://127.0.0.1:8000/ 拒绝了我们的连接请求。的一种解决方式
- python之最简http文件列表显示服务
- 利用Python批量测试一组HTTP服务的可用性
- python带给你的简单实用的http、ftp服务
- Python通过命令开启http.server服务器的方法
- Python的http服务(SimpleHTTPServer,BaseHTTPServer,CGIHTTPServer)
- 使用Python快速搭建HTTP服务和文件共享服务
- 非常简单的Python HTTP服务
- Windows Server使用python实现自动化运维——开启系统更新服务
- 搭建Python HTTP服务
- OpenStack常见错误:无法开启http服务 Job for httpd.service failed because the control process exited with error
- 使用Python快速搭建HTTP服务和文件共享服务的实例讲解
- 使用Python创建简单的HTTP和FTP服务
- Python实现批量检测HTTP服务的状态
- Python HTTP服务搭建显示本地文件
- Mac OS X 开启Http Ftp服务
- 使用 python -m SimpleHTTPServer 搭建http服务