摘要: random模块常用函数: 阅读全文
posted @ 2019-02-24 19:54 梦想与现实边缘 阅读(226) 评论(0) 推荐(0) 编辑
摘要: os.walk(top, topdown=True, onerror=None, followlinks=False) top:顶级目录 os.walk()返回一个三元tupple(dirpath, dirnames, filenames)的生成器,其中dirpath是一个string,代表目录的路 阅读全文
posted @ 2019-02-24 15:03 梦想与现实边缘 阅读(1453) 评论(0) 推荐(0) 编辑
摘要: fileinput模块功能: 提供拼接一个或多个文本文件的功能,可以通过使用for循环来读取一个或多个文本文件的所有行,从而进行逐行处理(如进行显示、替换、添加行号等)。 其功能类似于linux命令的cat和sed。 input方法是fileinput模块的主要方法,input方法的参数将传递给Fi 阅读全文
posted @ 2019-02-24 00:02 梦想与现实边缘 阅读(4281) 评论(0) 推荐(0) 编辑