path = r'C:\Users\Administrator\Desktop\\'+str(filetime)+'版本信息.xlsx' workbook = xl.Workbook() workbook.save(path) sheet = workbook.active headers = ['业务', '版本', '类型', 'remark'] sheet.append(headers) num = 1 for i in respose: result = [aa, version, bb, remark] # for data in result: # sheet.append(result) sheet.append(result) num = num + 1 print("保存成功\t") workbook.save(path)
filetime = time.strftime('%Y%m%d%H%M%S') total = len(respose) print("总共:{}条".format(total)) itertools.count(start=0, step=1) f = open(str(filetime)+"版本信息.txt", "w", encoding="utf-8") num = 1 for i in respose: num=num+1 # 这是txt f.write(f"{aa}\t{version}\t{bb}\t{remark}\r\n")