Update app.py
Browse files
app.py
CHANGED
@@ -86,12 +86,14 @@ def convert_schedule(file_path, direction):
|
|
86 |
# For display, include index as a column
|
87 |
display_df = result.reset_index().rename(columns={'index': first_col_name})
|
88 |
|
89 |
-
|
90 |
output_filename = f"converted_{uuid.uuid4().hex}.xlsx"
|
91 |
-
|
|
|
92 |
|
93 |
# Return both DataFrame and download path
|
94 |
return display_df, output_filename
|
|
|
95 |
|
96 |
# Build Gradio interface and launch immediately for Hugging Face Spaces
|
97 |
iface = gr.Interface(
|
|
|
86 |
# For display, include index as a column
|
87 |
display_df = result.reset_index().rename(columns={'index': first_col_name})
|
88 |
|
89 |
+
# 6. Save to Excel for download (relative path so Gradio can serve it)
|
90 |
output_filename = f"converted_{uuid.uuid4().hex}.xlsx"
|
91 |
+
# Save the display DataFrame (with index column) so first column appears properly, without an extra index
|
92 |
+
display_df.to_excel(output_filename, engine='openpyxl', index=False)
|
93 |
|
94 |
# Return both DataFrame and download path
|
95 |
return display_df, output_filename
|
96 |
+
return display_df, output_filename
|
97 |
|
98 |
# Build Gradio interface and launch immediately for Hugging Face Spaces
|
99 |
iface = gr.Interface(
|