Python vs. Ruby (and os.path.walk)

Peter Hansen peter at engcorp.com
Fri Aug 9 14:02:45 CEST 2002


William Park wrote:
> 
> On Fri, Aug 09, 2002 at 04:04:39AM +0000, Steven Atkinson wrote:
> > I'm trying to settle on Ruby or Python as my scripting language of choice.
> > There are some features of Ruby that I like, but I lean toward Python since
> > by day I'm a C++ programmer and Python seems more natural to me.
> > Unfortunately, in my first side by side test I discovered a _huge_
> > performance difference (at least for what I wanted to do). I need a simple
> > program that can clean out some tool generated source code. I'm recursively
> > searching 100's (probably close to or slightly over a 1000) directories
> > searching for certain file extensions (*_i.c, *_p.c,*.thi, *.thl) and then
> > removing them.
> 
> For crying out loud,
>     find -type f \( -name '*_[ip].c' -o -name '*.th[il]' \) | xargs rm

Cool!  I didn't know Windows NT supported "find" and "xargs" like
that...



More information about the Python-list mailing list