How to do it...

  1. Add this alias at the end of .bash_profile, as follows:
# ~/.bash_profile
alias delpyc='
find . -name "*.py[co]" -delete
find . -type d -name "__pycache__" -delete'
  1. Now, to clean the Python-compiled files, go to your project directory and type the following command on the command line:
(env)$ delpyc