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

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

WBOY
Release: 2016-06-10 15:17:19
Original
1501 people have browsed it

本文实例讲述了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.*')
Copy after login

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template