"""Sorry folks my mistake def is_dev should be:
def is_Dev(stringy):
stringx = stringy.split('-')
if stringx[0] == '':
if stringx[1] == r'win32':
if stringx[2] == r'app':
if stringx[4] == r'dev.tar.gz':
return 1
But now the results of the filter is an empty list and i know it shouldn't
be."""
I think the problem is the first "if" - using the list from your previous
mail, stringx[0] is never empty. So the filter fn never returns true, & the
return list is empty...
stringx[4] never matches either.
This is what I did:
compFiles=['logs', 'rqp-8.2.104.0.dep', 'rqp-8.2.93.0.dep', '
rqp-win32-app-8.2.96.0-inst.tar.gz', 'rqp-win32-app-8.2.96.0-inst.tar.gz ']
for i in compFiles:
print i.split('-') # ie the equivalent of stringx
['logs']
['rqp', '8.2.104.0.dep']
['rqp', '8.2.93.0.dep']
['rqp', 'win32', 'app', ' 8.2.96.0', 'inst.tar.gz']
['rqp', 'win32', 'app', ' 8.2.96.0', 'inst.tar.gz']
Birone
PS - I'm new at this. Please forgive me if I got it totally wrong!
--
http://mail.python.org/mailman/listinfo/python-list