Read number of CSV files

Smaran Harihar smaran.harihar at gmail.com
Mon Nov 12 13:32:43 EST 2012


Oh that is great.

[apology on sending the mail directly]

Thanks,
Smaran

On Mon, Nov 12, 2012 at 10:50 AM, Peter Otten <__peter__ at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20121112/a59d8786/attachment.html>


More information about the Python-list mailing list