Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

List comprehension - list files with extension in a directory

a = [name for name in os.listdir(".") if name.endswith(".txt")]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #List #comprehension #list #files #extension #directory
ADD COMMENT
Topic
Name
8+2 =