Python code example: Copy unmarked files in one folder to another

Python code example: Copy unmarked files in one folder to another

In this blog, we will describe how to write code in Python to copy unmarked files from one folder to another. With this sample code, we can quickly find files that exist in one folder but are unmarked in another folder, and copy them to the specified target folder.

# 导入新查找的文件夹,并遍历所有列表  
import os  
import shutil  
  
# 设置文件夹路径  
subfolder_path = 'F:/BaiduSyncdisk/code/010uci_make/数据/UIC_original'  
  
# 获取文件夹下所有文件的文件名  
subfolder = os.listdir(subfolder_path)  
  
# 设置文件夹路径  
Parent_folder_path = 

Guess you like

Origin blog.csdn.net/lihuanyu520/article/details/131619296