python小技巧汇总
摘要:# -*- coding: UTF-8 -*-#!/usr/bin/env pythondef pairwise(iterable): """ 交叉形成字典 """ itnext = iter(iterable).next while True: yield itnext(),itnext()def distinct(seq): """ 对序列进行去重 """ return dict.fromkeys(L).keys() if __name__ == '__main_
阅读全文
posted @ 2011-10-31 17:37