python socket发送接收示例,pythonsocket,import socke
python socket发送接收示例,pythonsocket,import socke
import socket, sysport = 70host = sys.argv[1]filename = sys.argv[2]s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)try: s.connect((host, port))except socket.gaierror, e: print 'Error connecting to server: %s' % e sys.exit(1)s.sendall(filename + '\r\n')while 1: buf = s.recv(1024) if not len(buf): break sys.stdout.write(buf)
相关内容
- List system variable keys and set a system parameter key,variablepa
- Class constructor parameter: dictionary,,class Bunch(
- python空构造函数,python构造函数,class C(obje
- Python使用子进程代替多线程,python进程多线程,import o
- python的 __getitem__方法示例,python__getitem_,class steppe
- Python用户定义类实现,python用户定义,class Worker
- python虚函数,python函数,class Base:
- python构造函数示例,python构造函数,# class Crit
- 输出系统路径,输出路径,import osos.
- Fill the fields of the record,fillfields,class Employ
评论关闭