$ find /path/to/dir -type f -name "*.py" -print0 | xargs -0 wc -l