Re: Recurse Directories and process files in directory

2006-08-12 Thread David Lewis
On 2006-08-12 09:46:54 -0700, "KraftDiner" <[EMAIL PROTECTED]> said: > Hi I need help writing a python script that traverses (recursivly) a > directory and its sub directories and processes all files in the > directory. In addition to os.walk, I find Jason Orendorff's 'path' module very helpful

Re: Recurse Directories and process files in directory

2006-08-12 Thread Jason Nordwick
Use os.system to execute a string and os.walk to get a recursive list of files >>> def processdir(curdir,subdirs,files): ... map(lambda f:os.system('\\cygwin\\bin\\wc -l "%s"' % f), [curdir+os.sep+x for x in files]) ... >>> map(lambda x:processdir(*x), os.walk('\\dev\qclient')); 6 \dev\qclie

Re: Recurse Directories and process files in directory

2006-08-12 Thread BartlebyScrivener
KraftDiner wrote: > Hi I need help writing a python script that traverses (recursivly) a > directory and its sub directories and processes all files in the > directory. There's a great os.walk + wrapper in the Python cookbook. I once had an unrelated problem with it, but check it out and see if it

Re: Recurse Directories and process files in directory

2006-08-12 Thread Gary Herron
KraftDiner wrote: > Hi I need help writing a python script that traverses (recursivly) a > directory and its sub directories and processes all files in the > directory. So at each directory if there are files in it I must build > a list of those files and process them by exectuing a system command

Re: Recurse Directories and process files in directory

2006-08-12 Thread vasudevram
KraftDiner wrote: > Hi I need help writing a python script that traverses (recursivly) a > directory and its sub directories and processes all files in the > directory. So at each directory if there are files in it I must build > a list of those files and process them by exectuing a system comman

Recurse Directories and process files in directory

2006-08-12 Thread KraftDiner
Hi I need help writing a python script that traverses (recursivly) a directory and its sub directories and processes all files in the directory. So at each directory if there are files in it I must build a list of those files and process them by exectuing a system command (exec?) Can some one tel