Python 增删改查 对比两个文件夹下文件名相同与不同

def CheckTrainData():
  a[] = load("images") #a[i]=文件名 save a[] to a.txt
  b[] = load("labels") #b[i]=文件名 save b[] to b.txt
#查找a[]中缺少label的
  for i=1:length(a):
    if a[i] is not in b[]:
      delete a[i]
#查找b[]中缺少images的
  for i=i:length(b):
    if b[i] is not in a[]:
      delete b[i]

 Python数组操作:https://www.w3school.com.cn/python/python_arrays.asp

原文地址:https://www.cnblogs.com/2008nmj/p/13621718.html