Skip to content

Instantly share code, notes, and snippets.

@neelratanguria
Created July 1, 2025 10:31
Show Gist options
  • Save neelratanguria/4e7ead5b32a1f2f90124301caecfee03 to your computer and use it in GitHub Desktop.
Save neelratanguria/4e7ead5b32a1f2f90124301caecfee03 to your computer and use it in GitHub Desktop.
import os
# Set the directory path
folder_path = './' # Replace with your folder path
# List all files and directories in the folder
all_entries = os.listdir(folder_path)
# Filter only files (exclude directories)
filenames = [f for f in all_entries if os.path.isfile(os.path.join(folder_path, f))]
# Print the filenames
for name in filenames:
print(name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment