Re: Code For Five Threads To Process Multiple Files?

2008-05-23 Thread tdahsu
On May 23, 12:20 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Thu, 22 May 2008 11:03:48 -0700 (PDT), [EMAIL PROTECTED] declaimed the > following in comp.lang.python: > > > Ah, well, I didn't get any other responses, but here's what I've done: > >         Apparently the direct email from my

Re: Code For Five Threads To Process Multiple Files?

2008-05-22 Thread tdahsu
On May 21, 11:41 am, [EMAIL PROTECTED] wrote: > On May 21, 11:13 am, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > > > > > On 2008-05-21, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > I'd appreciate any help.  I've got a list of files in a directory, and > > > I'd like to iterate through that l

Re: Code For Five Threads To Process Multiple Files?

2008-05-21 Thread tdahsu
On May 21, 11:13 am, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > On 2008-05-21, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > I'd appreciate any help.  I've got a list of files in a directory, and > > I'd like to iterate through that list and process each one.  Rather > > than do that serially,

Re: Code For Five Threads To Process Multiple Files?

2008-05-21 Thread A.T.Hofkamp
On 2008-05-21, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I'd appreciate any help. I've got a list of files in a directory, and > I'd like to iterate through that list and process each one. Rather > than do that serially, I was thinking I should start five threads and > process five files at

Code For Five Threads To Process Multiple Files?

2008-05-21 Thread tdahsu
All, I'd appreciate any help. I've got a list of files in a directory, and I'd like to iterate through that list and process each one. Rather than do that serially, I was thinking I should start five threads and process five files at a time. Is this a good idea? I picked the number five at ran

Re: Process multiple files

2008-04-14 Thread Duncan Booth
"Doran, Harold" <[EMAIL PROTECTED]> wrote: > If these files followed a naming convention such as 1.txt and 2.txt I > can easily see how these could be parsed consecutively in a loop. > However, they are not and so is it possible to modify this code such > that I can tell python to parse all .txt f

Re: Process multiple files

2008-04-14 Thread Tim Chase
> new_file = open('filename.txt', 'w') > params = open('eggs.txt', 'r') > do all the python stuff here > new_file.close() > > If these files followed a naming convention such as 1.txt and 2.txt I > can easily see how these could be parsed consecutively in a loop. > However, they are not and

Re: Process multiple files

2008-04-14 Thread Robert Bossy
Doran, Harold wrote: > Say I have multiple text files in a single directory, for illustration > they are called "spam.txt" and "eggs.txt". All of these text files are > organized in exactly the same way. I have written a program that parses > each file one at a time. In other words, I need to run m

Re: Process multiple files

2008-04-14 Thread Paul Anton Letnes
Funny, I'm just doing exactly this: import os def main(): dataFolder = 'data/' fileList = os.listdir(dataFolder) for file in fileList: inFile = open(dataFolder + file, 'r') print 'read inFile & do something useful here' Clear as an... egg?

Process multiple files

2008-04-14 Thread Doran, Harold
Say I have multiple text files in a single directory, for illustration they are called "spam.txt" and "eggs.txt". All of these text files are organized in exactly the same way. I have written a program that parses each file one at a time. In other words, I need to run my program each time I want to