Created
July 1, 2025 10:31
-
-
Save neelratanguria/4e7ead5b32a1f2f90124301caecfee03 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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