关于SimpleHTTPServer.py 模块

来源:互联网 发布:单片机isp程序下载接口 编辑:程序博客网 时间:2024/05/29 09:16

SimpleHTTPServer.py

这个模块基于BaseHTTPServer。

This module builds on BaseHTTPServer by implementing the standard GET andHEAD requests in a fairly straightforward manner.

默认路径:

/usr/lib64/python2.7/SimpleHTTPServer.py

 

使用自带包SimpleServer

import SocketServer

import SimpleHTTPServer

PORT=8000

Handler=SimpleHTTPServer.SimpleHTTPRequestHandler

httpd=SocketServer.TCPServer(('',PORT),Handler)

print 'server at port',PORT

httpd.serve_forever()