1. itertools

count()  cycle()  repeat()  chain() permutations combinations product groupby()

for key, group in itertools.groupby('AAABBBCCAAA'):
    print(key, list(group))
for key, group in itertools.groupby('AaaBBbcCAAa', lambda c: c.upper()):
    print(key, list(group))

 

2. random

3. os

4. sys

5. re

posted on 2017-04-18 20:44  MicN  阅读(203)  评论(0编辑  收藏  举报