是否将这些代码检查为python 产出(预期):['A':[10,11,12,13],'B':[1,2,3,4]] 但是,“B”值重复['A':[1,2,3,4],'B':[1,2,3,4]
import os
import glob
import pandas as pd
import numpy as np
Lotno_list = ['A','B']
count_merge = []
total_count = []
total_dict = {}
for Lotno in Lotno_list:
folder_list = os.listdir(r'../{}/'.format(lotno)) # get the folder_list in the folder (Lotno)
count_merge.clear()
for element in folder_list: # ex) folder_list = ['A01','A02','A03','A04'] when Lotno = 'A'into for
element_list = os.listdir(r'../{}/{}/'.format(lotno,element))
element_count = len(element_list)
# Count files in the folder ex) A01 ...
count_merge.append(element_count)
total_dict[Lotno] = count_merge
print(total_dict)
目前没有回答
相关问题 更多 >
编程相关推荐