Write a Python program to make file lists from the current directory using a wildcard.

 Write a Python program to make file lists from the current directory using a wildcard.

1
2
3
4
5
6
import glob
file_list = glob.glob('*.*')
print(file_list)
#Specific files
print(glob.glob('*.py'))
print(glob.glob('./[0-9].*'))

Final output

Leave a Comment