Skip to content

Instantly share code, notes, and snippets.

@CGLion
Created September 28, 2020 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CGLion/5e957c4a62c752fa9bfb07fde845b3b9 to your computer and use it in GitHub Desktop.
Save CGLion/5e957c4a62c752fa9bfb07fde845b3b9 to your computer and use it in GitHub Desktop.
Python - Lists all files in folder
from os import listdir
from os.path import isfile, join
dir = "D:\\"
files = [f for f in listdir(dir) if isfile(join(dir, f))]
for f in files:
print join(dir, f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment