INNER CODE UNIT · Python

patched_init

fzumstein/python-for-excel · sales_report_openpyxl.py:16

def patched_init(self, *args, **kwargs):
    _original_init(self, *args, **kwargs)
    self.Application = "Microsoft Excel"


ExtendedProperties.__init__ = patched_init

# Directory of this file
this_dir = Path(__file__).resolve().parent

# Read in all files
parts = []
for path in (this_dir / "sales_data").rglob("*.xls*"):
    print(f"Reading {path.name}")
    part = pd.read_excel(path, engine="calamine")
    parts.append(part)

# Combine the DataFrames from each file into a single DataFrame

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…