Created
December 12, 2024 18:53
-
-
Save arose13/eacce4715ec65d2db3fe4df78293053b to your computer and use it in GitHub Desktop.
Count the number of lines in your python project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Find all .py files and count their lines, excluding .venv directory | |
find . -name "*.py" -type f -not -path "./.venv/*" -exec wc -l {} \; | { | |
total=0 | |
while read -r lines file; do | |
echo "$lines lines in $file" | |
((total += lines)) | |
done | |
echo "-------------------------" | |
echo "Total: $total lines" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment