fork download
  1. from functools import partial
  2. import pandas as pd
  3.  
  4. ufv_name = ['CB1', 'CB2', 'CB3', 'GM1', 'IM1', 'JD2', 'PIU', 'STR']
  5.  
  6. def readxlsx(ufv, d, m):
  7. return (pd.read_excel(f'{d}PR_{ufv}_{m}.xlsx'), ufv)
  8.  
  9. def unir(dir, mes):
  10. f = partial(readxlsx, d=dir, m=mes)
  11. planilhas = list(map(f, ufv_name))
  12. with pd.ExcelWriter(f'{dir}Relatorio_total.xlsx', engine='xlsxwriter') as writer:
  13. for p in planilhas:
  14. p[0].to_excel(writer, sheet_name=p[1], index = False)
Success #stdin #stdout 0.48s 58936KB
stdin
Standard input is empty
stdout
Standard output is empty