newFields = []for i in range(len(self.fields["testResult"])): newFields.append(self.fields["testResult"][i]["log"][:-1]) finalFields = []for num in range(len(newFields)): if num == 0: finalFields.append(newFields[num]) else: length = len(newFields[num]) - len(newFields[num - 1]) d = copy.deepcopy(newFields[num]) new = [] for m in range(length): get = d.pop() new.insert(0, get) finalFields.append(new) for number in range(len(finalFields)): self.fields["testResult"][number]["log"] = finalFields[number] + [""]
原文地址:https://www.cnblogs.com/yanpan/p/11402688.html
时间: 2024-10-31 01:58:35