shutil
has many methods you can use. (shutil
有很多方法可以使用。) One of which is: (其中之一是:)
from shutil import copyfile
copyfile(src, dst)
Copy the contents of the file named src
to a file named dst
. (将名为src
的文件的内容复制到名为dst
的文件。) The destination location must be writable; (目标位置必须是可写的;) otherwise, an IOError
exception will be raised. (否则,将IOError
异常。) If dst
already exists, it will be replaced. (如果dst
已经存在,它将被替换。) Special files such as character or block devices and pipes cannot be copied with this function. (特殊文件(例如字符或块设备和管道)无法使用此功能进行复制。) src
and dst
are path names given as strings. (src
和dst
是以字符串形式给出的路径名。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…