1 Star 0 Fork 0

Gitee 极速下载/Scrapling

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/D4Vinci/Scrapling
克隆/下载
cleanup.py 1.01 KB
一键复制 编辑 原始数据 按行查看 历史
import shutil
from pathlib import Path
# Clean up after installing for local development
def clean():
# Get the current directory
base_dir = Path.cwd()
# Directories and patterns to clean
cleanup_patterns = [
"build",
"dist",
"*.egg-info",
"__pycache__",
".eggs",
".pytest_cache",
]
# Clean directories
for pattern in cleanup_patterns:
for path in base_dir.glob(pattern):
try:
if path.is_dir():
shutil.rmtree(path)
else:
path.unlink()
print(f"Removed: {path}")
except Exception as e:
print(f"Could not remove {path}: {e}")
# Remove compiled Python files
for path in base_dir.rglob("*.py[co]"):
try:
path.unlink()
print(f"Removed compiled file: {path}")
except Exception as e:
print(f"Could not remove {path}: {e}")
if __name__ == "__main__":
clean()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mirrors/Scrapling.git
git@gitee.com:mirrors/Scrapling.git
mirrors
Scrapling
Scrapling
dev

搜索帮助