Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python how to count ever yfile in fodler

def directory(path,extension):
  list_dir = []
  list_dir = os.listdir(path)
  count = 0
  for file in list_dir:
    if file.endswith(extension): # eg: '.txt'
      count += 1
  return count
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #count #yfile #fodler
ADD COMMENT
Topic
Name
9+1 =