Looking for a piece of python...

Bruce Marshall bmarsh
Sun May 22 13:22:29 PDT 2005


On Sunday 22 May 2005 01:56 pm, Jerry McBride wrote:
> Anyone have a piece of python that processes directories recursively?
>
> I've a vast mp3 collection that is broken up into hundreds of directories
> and... now... I need to do some file processing on them.
>
> Anyone?

I'm looking in O'Reilly's "Progrraming Python"  (for the first time) and they 
show an  os.path.walk   function

"To make it easy to apply an operation to all files in a tree, Python also 
comes with a utility that scans trees for us and runs a provided function at 
every directory along the way."

That may not be what you want, but I will read the section for something that 
will let you traverse trees.


-- 
+----------------------------------------------------------------------------+
+ Bruce S. Marshall  bmarsh at bmarsh.com  Bellaire, MI         05/22/05 14:46  +
+----------------------------------------------------------------------------+
"Nothing is real to you until you experience it, otherwise it's just
     hearsay. "


More information about the Linux-users mailing list