摘要: import re from collections import Counter string = """ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ut elit id mi ultricies adipiscing. Nulla facilisi. Praesent pulvinar... 阅读全文
posted @ 2017-05-29 12:59 TingShuo 阅读(141) 评论(0) 推荐(0)
摘要: 1 import time 2 3 def timethis(func): 4 """ 5 测试函数运行花费时间的装饰器 6 """ 7 def wrapper(*args, **kwargs): 8 start = time.time() 9 result = func(*args, **kwargs) 10 ... 阅读全文
posted @ 2017-05-29 12:33 TingShuo 阅读(579) 评论(0) 推荐(0)
摘要: os.walk: walk(top, topdown=True, onerror=None, followlinks=False) 参数: top 要遍历的目录地址 topdown 为真,则优先遍历top目录,否则优先遍历top的子目录(默认为True)(广度深度) onerror 需要一个 cal 阅读全文
posted @ 2017-05-29 11:58 TingShuo 阅读(1031) 评论(0) 推荐(0)