[Tutor] searching in files

R. Alan Monroe amonroe at columbus.rr.com
Wed Aug 11 16:42:05 CEST 2004


> I am writing a programme which includes searching some words in a txt file...
> How can I do this?Is there a module in python which can do that?

Check out the .readlines method for reading files.
Then have a look at the "in" keyword - it can tell you if a particular
string exists inside of another string.


Alan



More information about the Tutor mailing list