python list all files of directory in given pattern code example
Example: python list all files of directory in given pattern
import glob
print(glob.glob("/home/adam/*.txt"))
#output ['/home/adam/file1.txt', '/home/adam/file2.txt', .... ]
import glob
print(glob.glob("/home/adam/*.txt"))
#output ['/home/adam/file1.txt', '/home/adam/file2.txt', .... ]