Created
July 20, 2016 10:48
-
-
Save HuanMeng0/96d1aabefc39d9da1b7270219f223084 to your computer and use it in GitHub Desktop.
简易的python http服务器
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from BaseHTTPServer import HTTPServer,BaseHTTPRequestHandler | |
import shutil | |
class MyHttpHandler(BaseHTTPRequestHandler): | |
def do_GET(self): | |
self.send_response(200) | |
self.end_headers() | |
self.wfile.write("返回内容") | |
return | |
httpd=HTTPServer(('127.0.0.1',80),MyHttpHandler) | |
print("Server started .....") | |
httpd.serve_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment