Using
find . -type f -not -iwholename '*.git*' -iname "*.py" -print0 | xargs -0 perl -pi -e 's/ +$//'