且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

shutil.move删除了我所有的照片

更新时间:2023-11-20 21:33:40

我相信shutil.move只是拿了每个文件并将我的照片"解释为保存每个文件的名称,而不是将其复制到的目录.对于目录中的每个图像,它都将覆盖它,而我的照片"仅保留最后一个图像的内容.

I believe shutil.move simply took each file and interpreted "my photos" as the name to save each file as rather than a directory to copy it into. For each image in the directory, it would have overwritten it, leaving "my photos" with just the contents of the last image copied.

看看像人们如何使用shutil来移动文件的这样的示例,他们加入了基本目录名称以及形成target参数的文件名.

Looking at examples like this of how people have used shutil for moving files, they join the base directory name and the file name to form the target parameter.

我希望你有备份.