import glob
# path of the current directory
path = './Rough'
htmlfilesusing_glob = glob.glob(path + '/*.html')
print(htmlfilesusing_glob)
htmlfilesusing_iglob = glob.iglob(path + '/*.html')
print(htmlfilesusing_iglob)
# output
# ['./Roughhtml.html', './Roughindex.html']
# <generator object _iglob at 0x0000018A0F54A030>
Copy Code