def write_excel(): header = ["第一季度", "第二季度", "第三季度", "第四季度"] file_path = "C:/Users/liuchenhu/Desktop/文档/excel_test.xlsx" body = list() for item in range(1, 10): line = list() for i in range(1, len(header) + 1): line.append(i * random.randint(1, 10)) body.append(line) excel_util.create_excel(header, body, file_path)
def storage_excel(gzbd_data): header = ["地区", "日期", "确诊数", "境外输入数", "治愈数", "死亡数", "隔离数", "观察数"]; body = list(); for item in gzbd_data: line = []; line.append(item["日期"]); line.append(item["地区"]); line.append(item.get("确诊数", None)); line.append(item.get("境外输入数", None)); line.append(item.get("治愈数", None)); line.append(item.get("死亡数", None)); line.append(item.get("隔离数", None)); line.append(item.get("观察数", None)); body.append(line); file_path = "/temp/gzbd_data.xlsx"; excel_util.create_excel(header, body, file_path);
def create_layout_excel(cls): headers = [ "RUN", "Nombres", "Apellido Paterno", "Apellido Materno", "Puntaje Ingreso", "Sexo (MASCULINO/FEMENINO/NO DEFINIDO)", "Email", "Telefono", "Calle", "Numero", "Comuna", "Villa/Depto", "Id. Curso", "Id. Colegio" ] result_list = [Colegio.export_to_excel(), Curso.export_to_excel()] return create_excel(result_list, headers, "Formato_alumnos")
def create_layout_excel(cls, topicos): headers = ["Numero", "Alternativa Correcta", "Id. Topico"] result_list = [Topico.export_to_excel(topicos)] return create_excel(result_list, headers, "Formato_preguntas")
def create_layout_excel(cls): headers = ["RUT", "Nombres", "Apellido Paterno", "Apellido Materno", "Email", "Telefono", "Calle", "Numero", "Comuna", "Villa/Depto", "RUN Alumno"] result_list = [Alumno.export_to_excel()] return create_excel(result_list, headers, "Formato_apoderados")
def create_layout_excel(cls): headers = ["Nombre","Calle","Numero","Comuna"] result_list = [] return create_excel(result_list, headers, "Formato_colegios")