How to traverse and remove all. pyc files in a project

  python

To package the project, all. pyc files need to be removed.
Since some. pyc files are in the subdirectory inside, all of them do not know how to traverse and remove them.

If you are using linux or mac, do this at the terminal

find /tmp -name "*.pyc" | xargs rm -rf

If promptedPermission denied, use the

sudo find /tmp -name "*.pyc" | xargs rm -rf

Will the above/tmpReplace with the project directory. This command traverses and deletes pyc files under the project directory (including subdirectories).