Home >Backend Development >Python Tutorial >python通过shutil实现快速文件复制的方法

python通过shutil实现快速文件复制的方法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-10 15:17:191553browse

本文实例讲述了python通过shutil实现快速文件复制的方法。分享给大家供大家参考。具体如下:

python通过shutil实现快速文件拷贝,shutil使用起来非常方便,可以通过pip install shutil安装

from shutil import *
from glob import glob
print 'BEFORE:', glob('shutil_copyfile.*')
copyfile('sharejs.com.py', 'sharejs.com.py.copy')
print 'AFTER:', glob('shutil_copyfile.*')

上面这段python代码用于将文件 sharejs.com.py 拷贝到sharejs.com.py.copy

希望本文所述对大家的Python程序设计有所帮助。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn