On Oct 11, 5:40 pm, brad <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > On Oct 11, 5:22 pm, brad <[EMAIL PROTECTED]> wrote:
> >> Crazy question, but has anyone attempted this or seen Python code that
> >> does? For example, if a text file contained 'Guido' and or 'Robert' and
> >> or 'Susan', then we should return True, otherwise return False.
>
> > Can't you just use the string function .findall() ?
>
> I mean *any* possible person's name... I don't *know* the names
> beforehand :)

Well for something like that you could either do a search
for .istitle() through the file with a for loop, but that will catch
those after a full stop, or other random entries.

Otherwise, you get a HUGE list of all possible names? In dictionary
format for best option, and check the file against in using "in"...

However...how can you know it is a name...

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to