[Tutor] open multiple files

Kent Johnson kent37 at tds.net
Wed Aug 15 23:33:46 CEST 2007

Paulo Quaglio wrote:
> Hi everyone -
> I'm beginning to learn how to program in python. I need to process 
> several text files simultaneously. The program needs to open several 
> files (like a corpus) and output the total number of words. I can do 
> that with just one file but not the whole directory. I tried glob but it 
> didn't work. Your ideas are greatly appreciated.

Can you show us what you have so far?

Is this a homework problem?


More information about the Tutor mailing list