使用SocketServer 模块来完成服务端编程 1.服务端代码如下: #!/usr/bin/python #!coding:utf-8 import SocketServer as socketserver class ClientHandler(socketserver.BaseRequestHandler): def handle(self): print '[info] server has recive a connection :{0}'.format(self.client_ad