Oh that is great. [apology on sending the mail directly]
Thanks, Smaran On Mon, Nov 12, 2012 at 10:50 AM, Peter Otten <__pete...@web.de> wrote: > Peter Otten wrote: > > [please don't email me directly] > > > How is using glob different from os.listdir() Peter? > > glob retains the path and allows you to filter the files. Compare: > > >>> import os, glob > >>> os.listdir("alpha") > ['one.py', 'two.py', 'one.txt', 'three.py', 'three.txt', 'two.txt'] > >>> glob.glob("alpha/*") > ['alpha/one.py', 'alpha/two.py', 'alpha/one.txt', 'alpha/three.py', > 'alpha/three.txt', 'alpha/two.txt'] > >>> glob.glob("alpha/*.py") > ['alpha/one.py', 'alpha/two.py', 'alpha/three.py'] > > See the documentation for more. > > -- > http://mail.python.org/mailman/listinfo/python-list > -- Thanks & Regards Smaran Harihar
-- http://mail.python.org/mailman/listinfo/python-list