for root,dirs,files in os.walk(path): for file in files: f = (os.path.join(root,file)) if '.' in f and re.search('\w{4}$',f): var = f[-4:] kzm.append(var) elif '.' in f and re.search('\w{3}$',f): var = f[-3:] kzm.append(var) elif '.' in f and re.search('\w{2}$',f): var = f[-2:] kzm.append(var) for i in kzm: if kzm.count(i) >= 2 and newKzm.count(i) ==0: newKzm.append(i) elif kzm.count(i) == 1: newKzm.append(i) print(newKzm)
ÇëÎÊÏ£¬ÎÒµÄÊÇpython2.5°²×°ÁËPILÄ£¿é£¬È»ºó±àд³ÌÐò´ò¿ª±¾»úÉϵÄÒ»¸öͼƬʱ£¬ÎªÊ²Ã´ÀϳöÏÖ´íÎóÄØ£¬ÀÏÊÇÕÒ²»µ½Í¼Æ¬£¬´íÎóÌáʾÈçÏ£ºFile "C:\Python25\Lib\site-packages\PIL\Image.py", line 1888, in o ......