python实现拷贝指定文件到指定目录
2015-11-02 16:09
375 查看
python实现这个功能非常简单,因为库太强大了
import os import shutil alllist=os.listdir(u"D:\\notes\\python\\资料\\") for i in alllist: aa,bb=i.split(".") if 'python' in aa.lower(): oldname= u"D:\\notes\\python\\资料\\"+aa+"."+bb newname=u"d:\\copy\\newname"+aa+"."+bb shutil.copyfile(oldname,newname)
相关文章推荐
- python 类型转换函数
- python字符编码错误的解决方案
- Python - Json
- 以正确的方式开源 Python 项目(转)
- python 2.6 替换安装Python2.7
- python中关于装饰器的理解
- python , angular js 学习记录【3】
- 一些实用的python小脚本
- Python installation
- windows下搭建python+NLTK开发环境
- Python/scikit-learn机器学习库(线性、二次判别分析)
- Python单例模式终极版
- python-swap函数复制与赋值
- Python单例模式的4种实现方法
- Python--函数return后面的语句不执行
- window下从python开始安装科学计算环境
- python 小记
- leetcode之Find Median from Data Stream
- python小贴士之strip() split()
- Numpy 数组的切片操作