Skip to content

Instantly share code, notes, and snippets.

@llctrautmann
Created July 14, 2023 14:34
Show Gist options
  • Select an option

  • Save llctrautmann/dc18108d606feef5e481345655c90a9c to your computer and use it in GitHub Desktop.

Select an option

Save llctrautmann/dc18108d606feef5e481345655c90a9c to your computer and use it in GitHub Desktop.
Count_files_in_folder
import os
import glob
def count_files(folder_path):
file_list = glob.glob(os.path.join(folder_path, '*'))
return len(file_list)
# Specify the folder path you want to check
folder_path = '../data/AudioMNIST'
# Call the count_files function
num_files = count_files(folder_path)
print(f"Number of files in {folder_path}: {num_files}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment