python如何删除缓存文件

python删除缓存文件的方法:首先输入“find.-name '__pycache__' -type d -exec rm -rf {} ”命令删除所有子目录;然后输入“find.-name "*.pyc"”命令删除.pyc文件即可。

删除当前目录下的所有__pycache__子目录

find . -name '__pycache__' -type d -exec rm -rf {} 

删除当前目录下所有.pyc文件

find . -name "*.pyc"  | xargs rm -f

推荐课程:python语言设计(嵩天教授)

来源:PY学习网:原文地址:https://www.py.cn/article.html

hmoban主题是根据ripro二开的主题,极致后台体验,无插件,集成会员系统
自学咖网 » python如何删除缓存文件