
python代码片段
xiejunjie1
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python 移动指定目录下的txt文件到另外的目录
#coding=gb2312 #!/usr/bin/python import os import sys import os.path from shutil import copy for dirpath,dirnames,filenames in os.walk("f:/"): for filename in filenames: if os.path.spli原创 2015-07-18 00:02:28 · 5955 阅读 · 0 评论 -
python递归删除目录文件
def removeDir(dirPath): if not os.path.isdir(dirPath): return files = os.listdir(dirPath) try: for file in files: filePath=os.path.join(dirPath,file)转载 2015-07-18 07:54:27 · 1655 阅读 · 0 评论 -
Python 查找指定目录下.txt文件并移动到指定目录
#coding=gb2312 #!/usr/bin/python import os import sys import os.path from shutil import copy for dirpath,dirnames,filenames in os.walk("f:/"): for filename in filenames: if os.path.spli原创 2015-07-18 00:01:24 · 2248 阅读 · 1 评论 -
Python文件读取切割
文件内容,保存到f:/test/2.txt 1 xiejunjie 2 junjiex 3 aaaa 4 bbb 5 cccc f = open("f:/test/2.txt"); line = f.readline();//行读取 arr = []; while line: print line.split(" ")[1]; arr.append(line原创 2015-07-18 08:44:19 · 1617 阅读 · 0 评论