摘要: 代码示例如下: 1 #!/usr/local/bin python 2 import os 3 def swapextensions(dir, before, after): 4 if before[:1] != '.': 5 before = '.'+before 6 ... 阅读全文
posted @ 2015-01-21 16:49 Kirago 阅读(582) 评论(0) 推荐(0)
摘要: 涉及到的模块有os, fnmatch:1、通过os模块中的方法获取dir、subdir、files,通过os.path.join可拼接成完整路径; 2、fnmatch主要通过fnmatch.fnmatch(name, patterns),在patterns中匹配na... 阅读全文
posted @ 2015-01-21 14:32 Kirago 阅读(1131) 评论(0) 推荐(0)