遍历mac系统访达文件时候要注意了

遍历mac系统访达文件时候要注意了,每个文件夹会多出来一个隐藏文件.DS_Store,是用来储存文件夹配置信息的

import os
a,*b = os.walk(root_path) # a--> (root_path, children dirnames, children files)
files = a[-1]

for file in files:
	if file == '.DS_Store':
		continue

猜你喜欢

转载自www.cnblogs.com/lyzz1314/p/13170148.html
今日推荐