count number of lines in file code example
Example 1: python how to count the lines in a file
# Basic syntax:
count = len(open('/path/to/the/file.ext').readlines())
Example 2: count number of lines in directory linux
find . -name '*.php' | xargs wc -l