提问者:小点点

将文件复制到新文件夹需要很长时间-python


有什么方法可以加速舒提。收到吗? 我有大约300个文件,我试图复制,它花了很长时间。

代码:

for key, value in keys.items():
    new_directory = destination + value
    if not os.path.exists(new_directory):
        os.makedirs(new_directory)
    for file in source:
        # keeps the renamed files but also makes a copy of them in the correct company folder
        shutil.copy(key, new_directory)
    

共1个答案

匿名用户

没有。 操作系统复制文件所需的时间是一样长的。 好吧,要多久就多久。 你没有办法加快速度。