Skip to content

Instantly share code, notes, and snippets.

@Oschangkai
Created December 10, 2020 02:49
Show Gist options
  • Save Oschangkai/564c8f5615addfedc63f2211f380ce90 to your computer and use it in GitHub Desktop.
Save Oschangkai/564c8f5615addfedc63f2211f380ce90 to your computer and use it in GitHub Desktop.
Clean __pycache__ folder and files on any platform
python -Bc "import pathlib; [p.unlink() for p in pathlib.Path('.').rglob('*.py[co]')]"
python -Bc "import pathlib; [p.rmdir() for p in pathlib.Path('.').rglob('__pycache__')]"
# ref: https://stackoverflow.com/questions/28991015/python3-project-remove-pycache-folders-and-pyc-files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment