以下是把sourceDir目录下的以.JPG结尾的文件所有拷贝到targetDir目录下: <span style="font-size:18px;">>>>import os >>> import os.path >>> import shutil >>> def copyFiles(sourceDir,targetDir): for files in os.listdir(sourceDir): s
参考 https://docs.python.org/3/library/copy.html?highlight=copy%20copy#copy.copy https://en.wikipedia.org/wiki/Object_copying#Shallow_copy Fluent Python第四部分第8章 A shallow copy constructs a new compound object and then (to the extent possible) inserts re