![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
kingbird_Wang
努力奋斗中...
展开
-
Python 遍历文件夹
import osfor root, dirs, files in os.walk("rootdirectory"): for f in files: fileFullName = os.path.join(root, f) # do what you want to. 注:os.walk("rootdirectory")为每个以“rootDi原创 2012-01-05 10:27:06 · 1095 阅读 · 0 评论 -
Python 逐行读写文本文件
fileReadObj = open("input.txt")fileWriteObj = open("output.txt", 'w')fileLineText = fileReadObj.readline()while ('' != fileLineText): string = fileLineText fileWriteObj.write(string) fileLineTex原创 2012-01-05 10:25:00 · 15080 阅读 · 0 评论