2019年4月21日

遍历目录及文件

摘要: import os def traverse_doc(rootdir): for root,dirs,files in os.walk(rootdir) for file in files: fp=os.path.join(root,file) for dir in dirs: traverse_d 阅读全文

posted @ 2019-04-21 17:57 那年、年少 阅读(148) 评论(0) 推荐(0) 编辑

random模块函数

摘要: random()随机浮点数,0.0<=x<1.0 randrange(10) 0-9整数 randrange(0,101,2) 0-100偶数 choice(list1) 序列list1中随机选一个 shuffle(list1) 序列西派,改变原序列 sample(list1,k=5) 不改变原序列 阅读全文

posted @ 2019-04-21 17:35 那年、年少 阅读(134) 评论(0) 推荐(0) 编辑

导航