DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
4+1 =
Submit