Kent Johnson wrote:
Is os.popen("find") faster or slower than os.path.walk to find file pattern
in the
The general answer to "is find faster than os.[path.]walk faster" is "it
depends." Find is optimized, compiled, and fast at what it does.
However, what it does is somewhat limited. If you
On Fri, Aug 15, 2008 at 6:17 PM, Angela Yang <[EMAIL PROTECTED]> wrote:
> Hi Python gurus:
>
> Is os.popen("find") faster or slower than os.path.walk to find file pattern
> in the
> directory tree? I thought os.path.walk would be faster than unix find, but
> that doesn't
> seem to be the case?
In
On Friday 15 August 2008 17:17, Angela Yang wrote:
> Hi Python gurus:
>
>
>
> Is os.popen("find") faster or slower than os.path.walk to find file pattern
> in the
>
> directory tree? I thought os.path.walk would be faster than unix find, but
> that doesn't
>
> seem to be the case?
>
>
>
I'd expec
Hi Python gurus:
Is os.popen("find") faster or slower than os.path.walk to find file pattern in
the
directory tree? I thought os.path.walk would be faster than unix find, but
that doesn't
seem to be the case?
What is the fastest way in python to search for a file with a given pattern in
> Yes, that is the right way to do it and it will work fine. Something
> like
>
> class Walker(object):
> def walk(self, base):
>os.path.walk(base, self.callback, None)
>
> What happens is, when Python looks up self.callback it converts the
> method to a "bound method".
Aargh! I should hav
> What has got me worried is that the function called by os.path.walk
> must be a method of the class.
> Now this means it will have something like this as a def:
>
> def func_called_by_walk(self, arg, directory, names):
>
> Will this work with os.path.walk with that definition?
No, but you can w
nimrodx wrote:
> Hi All,
>
> I was wondering if anyone had used os.path.walk within a class or not,
> and what are the pitfalls...
>
> What has got me worried is that the function called by os.path.walk
> must be a method of the class.
> Now this means it will have something like this as a def:
Hi All,
I was wondering if anyone had used os.path.walk within a class or not,
and what are the pitfalls...
What has got me worried is that the function called by os.path.walk
must be a method of the class.
Now this means it will have something like this as a def:
def func_called_by_walk(self