The glob module finds all the pathnames matching a specific pattern according to the rules used by the Unix Shell. No tilde expansion is done, but *, ?, and character ranges expressed with  will be correctly matched.
To list all files ending with *.txt in /home/guest directory:
>>> import glob >>> glob.glob("/home/guest/*.txt")
[‘/home/guest/syslog.txt’, ‘/home/guest/mysql.txt’, ‘/home/guest/topics.txt’, ‘/home/guest/bus.txt’]
Similarly you can try others.
As mentioned above No tilde expansion will work, so following example will return empty list.