Posted on 26th April 2024
You can use the glob module because it is capable of doing patter matching and expansion just like this
import glob
print(glob.glob("/home/admin/*.txt"))
This will give you a list of queried files:
['/home/admin/file1.txt', '/home/admin/file2.txt', .... ]
STILL GOT QUERIES?