Last active
July 17, 2024 12:46
-
-
Save technocake/40b00d695e746a43926a88e531ab5548 to your computer and use it in GitHub Desktop.
Clear all python cache in directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pyclean command to clear all python cache in a directory | |
# source: https://stackoverflow.com/questions/28991015/python3-project-remove-pycache-folders-and-pyc-files | |
# in .bash_profile / .bash_rc etc put: | |
pyclean () { | |
find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete | |
} | |
# Now to delete all python cache in a directory do: | |
cd path/to/directory | |
pyclean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment