摘要: # -*-coding:utf-8-*- # # 文件夹内 # 1、统计总文件数量 # 2、统计各种格式文件数量 # 3、日志输出 # import os,time,sysdef getPrettyTime(): return time.strftime('%y-%m-%d %H:%M:%S', t 阅读全文
posted @ 2017-06-04 13:49 Yang_tao 阅读(1708) 评论(0) 推荐(0)
摘要: 全部函数可以用help(os)或是dir(os)查看其用法。 1.重命名:os.rename(old, new) 2.删除:os.remove(file) 3.列出目录下的文件 :os.listdir(path) 4.获取当前工作目录:os.getcwd() 5.改变工作目录:os.chdir(ne 阅读全文
posted @ 2017-06-04 12:52 Yang_tao 阅读(270) 评论(0) 推荐(0)