05 2017 档案

摘要:OSI七层 physical layer data link layer network layer transport layer session layer presentation layer application layer 阅读全文
posted @ 2017-05-27 13:55 ezway 阅读(118) 评论(0) 推荐(0)
摘要:1 import gevent 2 import requests 3 4 def f(url): 5 print('get %s'% url) 6 rq=requests.get(url) 7 data=rq.text 8 print(url,len(data)) 9 10 gevent.joinall([gevet.spawn(f... 阅读全文
posted @ 2017-05-25 10:02 ezway 阅读(107) 评论(0) 推荐(0)
摘要:class Foo(object): def __init__(self, frob, frotz): self.frobnicate = frob self.frotz = frotz class Bar(Foo): def __init__(self, frob, frizzle): super 阅读全文
posted @ 2017-05-16 15:23 ezway 阅读(307) 评论(0) 推荐(0)
摘要:def gg(): print(time.time()) return time.time() t1=threading.Thread(target=gg,) t2=threading.Thread(target=gg,) t2=threading.Thread() t1.start() t2.st 阅读全文
posted @ 2017-05-04 09:40 ezway 阅读(500) 评论(0) 推荐(0)
摘要:标准模板 阅读全文
posted @ 2017-05-03 00:48 ezway 阅读(124) 评论(0) 推荐(0)
摘要:UDP(user datagram protocol)用户数据协议 特点: 面向无连接:传输之前源端和目的端不需要简历连接 每个数据报的大小都在64K(8个字节)以内 传输快,不稳定 主要运用在:邮局寄件、实时聊天、视频会议 TCP(transmission control protocol)传输控 阅读全文
posted @ 2017-05-02 23:53 ezway 阅读(135) 评论(0) 推荐(0)
摘要:client #!usr/bin/evn python # -*- coding:utf-8 -*- import socket import os sk=socket.socket() print(sk) address=('127.0.0.1',8888) sk.connect(address) 阅读全文
posted @ 2017-05-02 23:16 ezway 阅读(114) 评论(0) 推荐(0)
摘要:c #! bin/usr/evn python # -*- coding:utf-8 -*- import socket,os sk=socket.socket() sk.connect(('127.0.0.1',8888)) BASE_DIR=os.path.dirname(__file__) w 阅读全文
posted @ 2017-05-02 20:42 ezway 阅读(150) 评论(0) 推荐(0)
摘要:server #server #!usr/bin/evn python # -*- coding:utf-8 -*- import socket import subprocess sk=socket.socket() addrs=('127.0.0.1',8888) sk.bind(addrs) 阅读全文
posted @ 2017-05-01 17:08 ezway 阅读(133) 评论(0) 推荐(0)