摘要: 1.生成器>>> def func1():... yield 0... yield 1... >>> a=func1()>>> a.next()0>>> a.next()1>>> a.next()Traceback (most recent call last): File "",... 阅读全文
posted @ 2014-07-04 17:47 Xjng 阅读(688) 评论(0) 推荐(0) 编辑
摘要: int_ip = lambda x: '.'.join([str(x/(256**i)%256) for i in range(3,-1,-1)])ip_int = lambda x:sum([256**j*int(i) for j,i in enumerate(x.split('.')[::-1]... 阅读全文
posted @ 2014-07-04 16:48 Xjng 阅读(1692) 评论(0) 推荐(0) 编辑