Spaces:
Sleeping
Sleeping
| import pandas as pd | |
| def read_excel(file_path): | |
| try: | |
| return pd.read_excel(file_path).to_dict(orient="records") | |
| except Exception: | |
| return [] | |
| def write_excel(file_path, data): | |
| try: | |
| pd.DataFrame(data).to_excel(file_path, index=False) | |
| except Exception as e: | |
| print(f"Error writing to {file_path}: {e}") | |