"Paulo Quaglio" <[EMAIL PROTECTED]> wrote > I'm beginning to learn how to program in python. > I need to process several text files simultaneously.
Do you really mean simultaneously or just all in the same execution of the program? ie The one program run opens each file in sequence and reports the total?. > The program needs to open several files (like a corpus) > and output the total number of words. OK, That sounds straightforward. > I can do that with just one file but not the whole directory. > I tried glob but it didn't work. glob usually works so I assume you mean that you didn't get it to do what you wanted? Recall that glob returns a list of filenames. You need to iterate over that list processing each file in turn. Can you show us a nbbit more of how you tried it? The code should be short enough that you can post it here on the list. Also post any error messages (the whole message not a summary). HTH, -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
