Answers for "rglob multiple extensions"

0

rglob multiple extensions

import glob
types = ('*.pdf', '*.cpp') # the tuple of file types
files_grabbed = []
for files in types:
    files_grabbed.extend(glob.glob(files))

# files_grabbed is the list of pdf and cpp files
Posted by: Guest on May-23-2021

Browse Popular Code Answers by Language