Re: Data Transmission Crash Course Required

2005-11-16 Thread The Prophet
Thank you both for the suggestions. I will look into both of them, as I
am eager to learn new things about Python.

-- 
http://mail.python.org/mailman/listinfo/python-list


os.walk trouble

2006-06-01 Thread The Prophet
As my first Python script, I am trying to make a program that recurses
a directory searching for files whose names match a pattern. I have a
basic idea of what the regexp would look like (and I can get more
information about that), but I am stuck with incorrect understanding of
os.walk. I've tried:

root, dirs, files = os.walk(dirname)

but it fails for some reason. I have seen this done before in the
tutorial (I think it's called sequence unpacking). What is the proper
way to do this?

Thanks in advance.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: os.walk trouble

2006-06-01 Thread The Prophet

Kent Johnson wrote:
> The Prophet wrote:
> > As my first Python script, I am trying to make a program that recurses
> > a directory searching for files whose names match a pattern.
>
> If your patterns are simple (supported by fnmatch), the path module
> makes this very easy:
> import path
> for f in path.path(dirname).walkfiles('*.foo'):
># process a .foo file here
>
> http://www.jorendorff.com/articles/python/path/index.html
>
> Kent

Well, it ain't that simple, but the suggestion is helpful, since I am
only a beginner. Thanks for everything, friends, now this aspect is
clear to me.

-- 
http://mail.python.org/mailman/listinfo/python-list