Hello I am trying to build a function that i can use in to search for an object or item from its name,
Here is what I have in sfind.py
def findobj(searchTxt,items): """ This function will help you find an object or an item from list of items passed to it. """ print items import re for each in items: print each result = re.search(searchTxt, each) #returns None if search fails if result: print each #and do whatever you need... return True else: print("Not found")
but every time i enter something to seach I get Not found.
try: reload(sfind) sfind.findobj("lambert1",['lambert1','lambert2','grey']) except: import sfind sfind.findobj("lambert1",['lambert1','lambert2','grey'])
please help me, I guess something wqrong with the seach behaviour....