Python Standard Library

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

原文地址:https://www.cnblogs.com/niuxichuan/p/6729879.html