cola 2 anos atrás
pai
commit
c3d73ba10d
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      handlers/HandlerBase.py

+ 2 - 2
handlers/HandlerBase.py

@@ -49,10 +49,10 @@ class BaseHandler(RequestHandler, DateUtils):
 
     def write_download(self, filename, data):
         self.set_header('Content-Type', 'application/octet-stream')
-        self.set_header('Content-Disposition', f'attachment; filename={filename}.csv')
+        self.set_header('Content-Disposition', f'attachment; filename={filename}.xlsx')
         self.set_header("Pargam", "no-cache")
         self.set_header("Cache-Control", "no-cache")
-        df = pd.DataFrame(data).to_csv(encoding='utf-8')
+        df = pd.DataFrame(data).to_excel(encoding='utf-8')
         # print(df)
         # with open(f'./{pitcher}_{start}_{end}.csv','w',newline='') as f:
         #     f.write(df)