SHARE
TWEET

Untitled

a guest Aug 21st, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # -*- coding=utf-8 -*-
  2.  
  3. import numpy as np
  4. import os
  5. import glob
  6.  
  7. listB=np.load('1_21list.npy')
  8.  
  9.  
  10. #载入list
  11. file_list=glob.glob('/data/data/wangxiao_data/wangxiao_data/choose/*')
  12. #获取更目录
  13. listA=[os.path.basename(i) for i in file_list]
  14.  
  15. #取交集
  16. inter_list=list(set(listA).intersection(set(listB)))
  17.  
  18. #获取删除list
  19. remove_list=[os.path.join('/data/data/wangxiao_data/wangxiao_data/choose/',i) for i in inter_list]
  20.  
  21. #进行删除
  22. for rmlist in remove_list:
  23.     os.remove(rmlist)
  24.     print(rmlist)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top