class MyOut(): def write(self, str): socket.send(str) o = MyOut() oldout = sys.stdout sys.stdout = o print "This line will be sent over socket..." sys.stdout = oldout # restore it
37,720
社区成员
34,239
社区内容
加载中
试试用AI创作助手写篇文章吧