python使用shutil模块,进行文件的拷贝。
代码:
import shutil
srcDir= "c:"
srcFileList=['1.txt','jbxue.txt']
dstDir="d:"
dstFileList=['1.txt','jbxue.txt']
srcFile = [(srcDir+file) for file in srcFileList]
dstFile = [ (dstDir+file) for file in dstFileList]
for file in srcFileList:
shutil.copy( srcDir+file,dstDir+file)
print("copy "+(srcDir+file)+" to "+(dstDir+file))