Created
January 11, 2019 14:18
-
-
Save travis23/4f21e7528f6b707389b493812ba51edf to your computer and use it in GitHub Desktop.
[files in directory] get a list of all the files in a directory #os #filename #python
This file contains 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
# See | |
# https://stackoverflow.com/questions/3207219/how-do-i-list-all-files-of-a-directory | |
from os import listdir | |
from os.path import isfile, join | |
onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment