[Tutor] string.find is odd

Kirk Bailey deliberatus@my995internet.com
Wed, 12 Dec 2001 04:03:36 -0500


Messing with string.find;
much confused, the process I wrote worked, dhis is barking. LOOK:

>>> members
['I', 'You', 'He', 'She', 'It', 'We', 'you', 'They']
>>> string.find("it",members)
Traceback (most recent call last):
  File "<pyshell#27>", line 1, in ?
    string.find("it",members)
  File "C:\PYTHON21\lib\string.py", line 171, in find
    return s.find(*args)
TypeError: expected a character buffer object
>>> string.find(members,"It")
Traceback (most recent call last):
  File "<pyshell#28>", line 1, in ?
    string.find(members,"It")
  File "C:\PYTHON21\lib\string.py", line 171, in find
    return s.find(*args)
AttributeError: find
>>>|

ok, I want to searh through a list, and return a non negative value
(='TRUE') if the search object is found.
The searched list is called 'Members'.
The search object is a string variable named 'From'.
arg...

Good night.