Skip to content

Instantly share code, notes, and snippets.

@mmaul8
Created January 20, 2020 10:07
Show Gist options
  • Select an option

  • Save mmaul8/2ff5b4c8884d4c6619286b191f3b6cdd to your computer and use it in GitHub Desktop.

Select an option

Save mmaul8/2ff5b4c8884d4c6619286b191f3b6cdd to your computer and use it in GitHub Desktop.
This script to read the name of all files in a directory
import os
basepath = input("Please input your specific directory : ")
#input example C:\Users\John\Downloads\
for entry in os.listdir(basepath):
if os.path.isfile(os.path.join(basepath, entry)):
print(entry)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment