Curious issue with simple code

codefire tony.bedford at gmail.com
Tue Sep 19 17:34:07 EDT 2006


George Sakkis wrote:

> By the way, an easier way to deal with paths is the path.py module
> (http://www.jorendorff.com/articles/python/path/). Your example could
> be rewritten simply as:
>
> from path import path
> for html_file in path(start_dir).walkfiles('*.html'):
>     print 'html file found!'
>

Thanks George,

I had played with it some more and ended up with the fairly succinct:

[code]
import os
import glob

for f in glob.glob('c:\\intent\\docn\\*\\*.html'):
    print f
[/code]

It works quite nicely - I'm just twiddling - first time writing Python
(but like it) :)
I've bookmarked that site too for future ref.

Thanks again,
Tony




More information about the Python-list mailing list