Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python select file in folder given extension

# use endswith(".extension")

import os
for file in os.listdir("/mydir"):
    if file.endswith(".txt"):
        print(os.path.join("/mydir", file))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #select #file #folder #extension
ADD COMMENT
Topic
Name
7+7 =