What is the BEST way to clear out all the __pycache__ folders and .pyc/.pyo files from a python3 project. I have seen multiple users suggest the pyclean script bundled with Debian, but this does not remove the folders. I want a simple way to clean up the project before pushing the files to my DVS.
__pycache__
.pyc/.pyo
pyclean
You can do it manually with the next command:
find . | grep -E "(__pycache__|.pyc|.pyo$)" | xargs rm -rf
This will remove all *.pyc files and __pycache__ directories recursively in the current directory.
1.4m articles
1.4m replys
5 comments
57.0k users