Update app.py
Browse files
app.py
CHANGED
|
@@ -432,7 +432,7 @@ def download_excel():
|
|
| 432 |
return None, "Error: Carga los datos primero."
|
| 433 |
|
| 434 |
# Create a temporary file
|
| 435 |
-
temp_file =
|
| 436 |
|
| 437 |
with pd.ExcelWriter(temp_file.name, engine='xlsxwriter') as writer:
|
| 438 |
rsm.data.to_excel(writer, sheet_name='Datos', index=False)
|
|
@@ -452,7 +452,7 @@ def download_images():
|
|
| 452 |
return None, "Error: No se han generado gr谩ficos."
|
| 453 |
|
| 454 |
# Create a temporary file
|
| 455 |
-
temp_file =
|
| 456 |
|
| 457 |
with zipfile.ZipFile(temp_file.name, 'w', zipfile.ZIP_DEFLATED) as zipf:
|
| 458 |
for i, fig in enumerate(plot_images):
|
|
@@ -477,7 +477,7 @@ def generate_rsm_plot(fixed_variable, fixed_level):
|
|
| 477 |
fig = plot_images[current_plot_index]
|
| 478 |
|
| 479 |
# Create a temporary file for the image
|
| 480 |
-
temp_file =
|
| 481 |
fig.write_image(temp_file.name)
|
| 482 |
|
| 483 |
return fig, "", temp_file.name
|
|
|
|
| 432 |
return None, "Error: Carga los datos primero."
|
| 433 |
|
| 434 |
# Create a temporary file
|
| 435 |
+
temp_file = zipfile.NamedTemporaryFile(delete=False, suffix='.xlsx')
|
| 436 |
|
| 437 |
with pd.ExcelWriter(temp_file.name, engine='xlsxwriter') as writer:
|
| 438 |
rsm.data.to_excel(writer, sheet_name='Datos', index=False)
|
|
|
|
| 452 |
return None, "Error: No se han generado gr谩ficos."
|
| 453 |
|
| 454 |
# Create a temporary file
|
| 455 |
+
temp_file = zipfile.NamedTemporaryFile(delete=False, suffix='.zip')
|
| 456 |
|
| 457 |
with zipfile.ZipFile(temp_file.name, 'w', zipfile.ZIP_DEFLATED) as zipf:
|
| 458 |
for i, fig in enumerate(plot_images):
|
|
|
|
| 477 |
fig = plot_images[current_plot_index]
|
| 478 |
|
| 479 |
# Create a temporary file for the image
|
| 480 |
+
temp_file = zipfile.NamedTemporaryFile(delete=False, suffix='.png')
|
| 481 |
fig.write_image(temp_file.name)
|
| 482 |
|
| 483 |
return fig, "", temp_file.name
|