python网络基础学习笔记:一个简单的socket调用
#! /usr/bin/env pythonimport socket, sysport = 70host = "quux.org"path = "/"s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)s.connect((host, port))fd = s.makefile('rw', 0)fd.write(path + "\r\n")for line in fd: sys.stdout.write(line)