1
2
3import glob
4
5files = glob.glob("D:\\**\\*.jpg",recursive=True)
6# All jpg files
7print(files)
8
9#JPEGs files with special characters in their name
10# set of special characters _, $, #
11char_seq = "_$#"
12for char in char_seq:
13 results = "*" + glob.escape(char) + "*" + ".jpg"
14 for file in (glob.glob(results)):
15 print(file)
16
17
18
19
20