Spaces:
Sleeping
Sleeping
| #!/usr/bin/env python3 | |
| """Clear Python cache before starting app""" | |
| import os | |
| import shutil | |
| from pathlib import Path | |
| # Clear all __pycache__ directories | |
| for pycache in Path('.').rglob('__pycache__'): | |
| print(f"Removing {pycache}") | |
| shutil.rmtree(pycache, ignore_errors=True) | |
| # Clear .pyc files | |
| for pyc in Path('.').rglob('*.pyc'): | |
| print(f"Removing {pyc}") | |
| pyc.unlink(missing_ok=True) | |
| print("✅ Cache cleared!") | |