python学习

文件遍历

root,subdir,file = os.walk()

subdir[:]=[]  不遍历子目录

 

文件读取

path+getcwd()

open(file,'r',encode='utf-8')

文件写入

open(file,'w',encode='utf-8')

posted @ 2018-06-08 16:38  年轻的卖油翁  阅读(103)  评论(0编辑  收藏  举报