Python implements the method of quick file copying through shutil

  • 2020-04-02 14:38:43
  • OfStack

This article illustrates python's approach to rapid file copying through shutil. Share with you for your reference. The details are as follows:

Python USES shutil for quick file copying, which is easy to use and can be installed by 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.*')

The above python code is used to copy the file sharejs.com.py to sharejs.com.py.copy

I hope this article has helped you with your Python programming.


Related articles: