Spaces:
Runtime error
Runtime error
| import shutil | |
| import os | |
| import psutil | |
| # 🧹 مجلدات راح تنمسح | |
| folders_to_delete = ["./output", "./__pycache__", "./.cache", "./temp"] | |
| print("🧹 جاري تنظيف الملفات المؤقتة...\n") | |
| for folder in folders_to_delete: | |
| if os.path.exists(folder): | |
| try: | |
| shutil.rmtree(folder) | |
| print(f"🗑️ تم حذف: {folder}") | |
| except Exception as e: | |
| print(f"⚠️ ما قدر يحذف {folder}: {e}") | |
| else: | |
| print(f"✅ {folder} غير موجود، تجاهل.") | |
| # 🧠 طباعة استهلاك RAM بعد التنظيف | |
| mem = psutil.virtual_memory() | |
| print(f"\n🧠 RAM Usage بعد التنظيف: {mem.used / 1e9:.2f} GB / {mem.total / 1e9:.2f} GB") | |