import os,re
def list_dir(file_dir):
dir_list = os.listdir(file_dir)
for cur_file in dir_list:
path = os.path.join(file_dir,cur_file)
if os.path.isfile(path):
dir_files = os.path.join(file_dir, cur_file)
if os.path.splitext(path)[1] == '.csv':
csv_file = os.path.join(file_dir, cur_file)
list_csv.append(csv_file)
if os.path.isdir(path):
list_dir(path)
return list_csv
if __name__ == '__main__':
paths = r'E:\\new_data\\A\\co_data'
list_csv = []
list_new=[]
list_dir(file_dir=paths)
for i in list_csv :
i=i.split("\\")[-1][:6]
list_new.append(i)
print(len(list_new))
new_l1 = []
for i in list_new:
if i not in new_l1:
new_l1.append(i)
print(len(new_l1))