Answers for "glob.glob python"

4

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

glob.glob python

glob.glob("/home/ismail/*.txt")
Posted by: Guest on April-25-2020
0

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

Python Answers by Framework

Browse Popular Code Answers by Language