ParallelPurge is a high-performance disk space cleaning tool developed based on Python + PyQt6. It uses multiprocessing technology to accelerate disk scanning and file deletion operations, and provides a visual interface to realize size scanning, sorting display, and batch deletion of disk files/folders. It solves the problems of slow scanning and unintuitive operation of traditional single-threaded tools.
- 🚀 Multiprocessing Acceleration: Utilizes multi-core CPUs for parallel scanning/deletion, supports custom process count (1-128), and significantly improves processing speed
- 🎯 Multi-Depth Scan Modes: Three scan modes balancing speed and depth:
- Fast Mode: Only scans the first layer of files/folders under the selected path
- Deep Mode: Scans the first 3 layers of content under the selected path
- Full Mode: Recursively scans all layers (suitable for detailed cleaning)
- 🖥️ User-Friendly Visual Interface:
- Tree structure display for files/folders, sorted in descending order by size
- Real-time progress bars for scanning/deletion progress
- Automatic size formatting (B/KB/MB/GB/TB) for intuitive understanding
- ✅ Secure Deletion: Double confirmation before deletion to avoid misoperation; real-time feedback on deletion progress
- 🛡️ High Robustness: Includes exception handling mechanisms, compatible with special files and insufficient permission scenarios
| Dependency | Version Requirement | Description |
|---|---|---|
| Python | 3.8 or higher | Python 3.9/3.10 recommended (better compatibility) |
| PyQt6 | No specific version | Core UI framework |
| OS | Windows/Linux/macOS | Cross-platform support (permission required for Windows) |
Ensure Python environment is installed, verify with the following command:
python --version # Or python3 --version (Linux/macOS)pip install PyQt6
# If pip points to Python2, use: pip3 install PyQt6- Save the code as
main.py - Launch the tool with the following command:
python main.py
# Or python3 main.py (Linux/macOS)- Select Scan Path:
- Click the "Browse" button to select the folder to scan, or manually enter the path in the input box
- Configure Scan Parameters:
- Scan Depth: Select "Fast Mode / Deep Mode / Full Mode"
- Process Count: Default 8, adjustable according to CPU cores (recommended not to exceed CPU cores × 2)
- Start Scanning:
- Click "Start Scan", the scan progress bar will display real-time progress
- After scanning, the tree list will display all files/folders in descending order by size
- Delete Files/Folders:
- Select the items to delete (supports multi-selection with Ctrl/Shift)
- Click "Add and Execute Deletion", confirm deletion to start execution
- The deletion progress bar shows deletion progress, and a prompt will pop up upon completion
- Expand Folders: Click the arrow before the folder in the tree list to view sub-items (unspecified scan layers will calculate size in real-time)
- Sorting Rule: All files/folders are sorted in descending order by size by default, facilitating quick location of large files
| Module | Function Description |
|---|---|
| ScanWorker | Implements scanning based on QThread + multiprocessing to avoid UI blocking, caches size information of all paths |
| DeleteWorker | Batch deletes files/folders with multiprocessing, provides real-time feedback on deletion results |
| Utility Functions | format_size (size formatting), get_dir_size_limitless (recursively calculate folder size) |
| UI Interface | Main interface built with PyQt6, including path input, scan control, tree display, progress bars and other components |
⚠️ Data Security: Deletion operations are irreversible (files will not go to Recycle Bin), ensure the selected items are unnecessary- 🔑 Permission Issues: Scanning/deleting system folders (e.g., C:\Windows for Windows, /root for Linux) requires administrator/root privileges
- ⚡ Performance Suggestion: Do not set the process count too high (e.g., over 128), otherwise CPU scheduling overhead will increase and reduce efficiency
- 📦 Package as Executable File (Optional):
To package as an executable file without Python environment, use PyInstaller:
# Windows (single file + no console) pyinstaller -F -w -i icon.ico parallel_purge.py # Linux/macOS pyinstaller -F -i icon.icns parallel_purge.py
- Scanning Stuck/Slow:
- Check if the path contains a large number of small files/network drives
- Reduce process count or select "Fast Mode" to locate large folders first
- Deletion Failed:
- Confirm the file/folder is not occupied by other programs (e.g., open files, running programs)
- Check if you have sufficient deletion permissions
- ParallelPurge's core advantages are multiprocessing acceleration and visual operation, solving the problems of slow scanning and unintuitive operation of traditional disk cleaning tools;
- Pay attention to permissions and data security during use, and confirm the target items before deletion;
- Supports cross-platform operation, and you can adjust scan depth and process count according to actual needs to balance speed and resource usage.
ParallelPurge 是一款基于 Python + PyQt6 开发的高性能磁盘空间清理工具,采用多进程技术加速磁盘扫描和文件删除操作,提供可视化界面实现磁盘文件/文件夹的大小扫描、排序展示和批量删除,解决传统单线程扫描慢、操作不直观的问题。
- 🚀 多进程加速:利用多核CPU并行扫描/删除,支持自定义进程数(1-128),大幅提升处理速度
- 🎯 多深度扫描模式:提供3种扫描模式,兼顾速度与深度:
- 快速模式:仅扫描选定路径下第一层文件/文件夹
- 深度模式:扫描选定路径下前3层内容
- 全量模式:递归扫描所有层级(适合精细清理)
- 🖥️ 友好可视化界面:
- 树形结构展示文件/文件夹,按大小降序排列
- 实时进度条显示扫描/删除进度
- 大小自动格式化(B/KB/MB/GB/TB),直观易懂
- ✅ 安全删除:删除前二次确认,避免误操作;删除进度实时反馈
- 🛡️ 鲁棒性强:包含异常处理机制,兼容特殊文件/权限不足场景
| 依赖项 | 版本要求 | 说明 |
|---|---|---|
| Python | 3.8 及以上 | 推荐3.9/3.10(兼容性更好) |
| PyQt6 | 无特定版本 | 核心UI框架 |
| 操作系统 | Windows/Linux/macOS | 跨平台支持(Windows需注意权限) |
确保已安装Python环境,可通过以下命令验证:
python --version # 或 python3 --version(Linux/macOS)pip install PyQt6
# 若pip指向Python2,使用:pip3 install PyQt6- 将代码保存为
main.py - 执行以下命令启动工具:
python main.py
# 或 python3 main.py(Linux/macOS)- 选择扫描路径:
- 点击「浏览」按钮选择要扫描的文件夹,或手动在输入框中输入路径
- 配置扫描参数:
- 扫描深度:选择「快速模式/深度模式/全量模式」
- 进程数:默认8,可根据CPU核心数调整(建议不超过CPU核心数×2)
- 开始扫描:
- 点击「开始扫描」,扫描进度条会实时显示进度
- 扫描完成后,树形列表会按大小降序展示所有文件/文件夹
- 删除文件/文件夹:
- 选中要删除的项(支持按住Ctrl/Shift多选)
- 点击「添加并执行删除」,确认删除后开始执行
- 删除进度条显示删除进度,完成后会弹出提示
- 展开文件夹:点击树形列表中文件夹前的箭头,可展开查看子项(未预扫描的层级会实时计算大小)
- 排序规则:所有文件/文件夹默认按大小降序排列,便于快速定位大文件
| 模块 | 功能说明 |
|---|---|
| 扫描核心(ScanWorker) | 基于QThread+多进程实现扫描,避免UI阻塞,缓存所有路径大小信息 |
| 删除核心(DeleteWorker) | 多进程批量删除文件/文件夹,实时反馈删除结果 |
| 工具函数 | format_size(大小格式化)、get_dir_size_limitless(递归计算文件夹大小) |
| UI界面 | PyQt6构建的主界面,包含路径输入、扫描控制、树形展示、进度条等组件 |
⚠️ 数据安全:删除操作不可逆(文件不会进入回收站),务必确认选中的项是不需要的内容- 🔑 权限问题:扫描/删除系统文件夹(如Windows的C:\Windows、Linux的/root)需要管理员/root权限
- ⚡ 性能建议:进程数设置不宜过大(如超过128),否则会导致CPU调度开销增加,反而降低效率
- 📦 打包成可执行文件(可选):
若需要打包为无Python环境的可执行文件,可使用PyInstaller:
# Windows(单文件+无控制台) pyinstaller -F -w -i icon.ico parallel_purge.py # Linux/macOS pyinstaller -F -i icon.icns parallel_purge.py
- 扫描卡住/速度慢:
- 检查路径是否包含大量小文件/网络驱动器
- 降低进程数,或选择「快速模式」先定位大文件夹
- 删除失败:
- 确认文件/文件夹未被其他程序占用(如打开的文件、正在运行的程序)
- 检查是否有足够的删除权限
- ParallelPurge 核心优势是多进程加速和可视化操作,解决了传统磁盘清理工具扫描慢、操作不直观的问题;
- 使用时需注意权限和数据安全,删除前务必确认目标项;
- 支持跨平台运行,可根据实际需求调整扫描深度和进程数以平衡速度与资源占用。
- 文档包含完整的英文+中文双版本,结构完全对应,术语翻译准确且符合技术文档规范;
- 保留了原有的功能说明、安装步骤、使用指南等核心内容,确保实用性和易读性;
- 核心技术点(多进程、PyQt6、扫描深度)在双语版本中保持一致的表述,便于不同语言用户理解。
