>>> q = ('C:\\$Recycle.Bin', ['S-1-5-18', 'S-1-5-21-1203370924-186465415-478134099-1000', 'S-1-5-21-1203370924-186465415-478134099-1001'], []), ('C:\\$Recycle.Bin\\S-1-5-18', [], ['desktop.ini']), ('C:\\$Recycle.Bin\\S-1-5-21-1203370924-186465415-478134099-1000', [], ['desktop.ini'])
>>> def find_str(q1, str1):
... if isinstance(q1, tuple):
... for x in q1:
... find_str(x, str1)
... elif isinstance(q1, list):
... for x in q1:
... if x==str1:print x
... else:
... if q1==str1:print q1
...
>>> find_str(q, 'desktop.ini')
desktop.ini
desktop.ini