笔记 · · 7 阅读

python 把一个文件夹的文件移动到另外一个文件夹

https://blog.csdn.net/qq_26948675/article/details/89487879

import os,shutil
import time
src_path='F:/oanda/'
target_path='D:/oanda/'
while True:
    time.sleep(3)
    file_list=os.listdir(src_path)
    if len(file_list)>0:
        for file in file_list:
            shutil.move(src_path+file,target_path+file)