Answers for "glob.glob python example"

5

python glob

import glob

print 'Named explicitly:'
for name in glob.glob('dir/subdir/*'):
    print 't', name

print 'Named with wildcard:'
for name in glob.glob('dir/*/*'):
    print 't', name
Posted by: Guest on October-23-2020
1

How to use Python Glob Module

import glob
# path of the current directory
path = '.'
curfiles = glob.glob(path + '/*.html')
for file in curfiles:
    print(file)
Posted by: Guest on August-08-2021
0

python glob subdirectories

import glob

subdirectories = glob.glob("./*/")
Posted by: Guest on October-04-2020

Python Answers by Framework

Browse Popular Code Answers by Language