python - 如何访问 _pycache_ 目录
问题描述
我想删除一个文件夹,但我无法进入pycache删除pyc
和 pyo$ 文件。我以前做过,但我不知道我是怎么做到的。
解决方案
如果您想删除python
文件工件,例如.pyc
和.pyo
缓存文件,也许您可以尝试以下操作:
移动到项目的根目录
cd <path_to_project_root>
删除 python 文件工件
find . -name '*.pyc' -exec rm -f {} + find . -name '*.pyo' -exec rm -f {} +
希望这会有所帮助!
推荐阅读
- php - 一小时后我没有得到 refreshToken
- git - git diff A...HEAD 加上索引和未暂存的文件?
- javascript - 无法读取 null 的属性(读取“_id”)
- azure-devops - 将 if-then-else 逻辑添加到 Azure DevOps 发布管道
- file - Apache parquet 文件的扩展名,是“.pqt”还是“.parquet”?
- google-data-studio - 如何在 Google Data Studio 中创建垂直表格
- c# - c#比较2个元组列表
- javascript - 获取 querySelector(x).innerText 的特定部分
- windows - Windows 10 - 清除 CMD 批处理脚本中的事件日志,所有输出都在同一行上运行?
- sorting - 对 Pandas 进行分组和排序