python Python TCP服务器从头开始

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python Python TCP服务器从头开始相关的知识,希望对你有一定的参考价值。

#!/usr/bin/env python
# coding:utf-8
import SocketServer
from SimpleHTTPServer import SimpleHTTPRequestHandler

PORT = 8001


class BaseHandler(SimpleHTTPRequestHandler):
    def do_GET(self):
        return


httpd = SocketServer.TCPServer(("", PORT), BaseHandler)

print "serving at port", PORT
httpd.serve_forever()

以上是关于python Python TCP服务器从头开始的主要内容,如果未能解决你的问题,请参考以下文章