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.
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.