glob escape 28 29 method in python glob module

Solutions on MaxInterview for glob escape 28 29 method in python glob module by the best coders in the world

showing results for - "glob escape 28 29 method in python glob module"
Martina
14 Jul 2019
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
similar questions