On Fri, Dec 5, 2008 at 9:35 AM, Guy Doune <[EMAIL PROTECTED]> wrote: >>>> test=['03.html', '06.html', 'questions.html', '04.html', 'toc.html', >>>> '01.html', '05.html', '07.html', '02.html', '08.html'] >>>> test > ['03.html', '06.html', 'questions.html', '04.html', 'toc.html', '01.html', > '05.html', '07.html', '02.html', '08.html'] >>>> test[4] > 'toc.html' >>>> test[4].strip('.html') > 'oc'
I believe you're after this: >>> test=['03.html', '06.html', 'questions.html', '04.html', 'toc.html', >>> '01.html', '05.html', '07.html', '02.html', '08.html'] >>> test ['03.html', '06.html', 'questions.html', '04.html', 'toc.html', '01.html', '05.html', '07.html', '02.html', '08.html'] >>> from os.path import splitext >>> files = [splitext(x)[0] for x in test] >>> files ['03', '06', 'questions', '04', 'toc', '01', '05', '07', '02', '08'] >>> And no, it's not a bug. Read the docs :) cheers James -- -- -- "Problems are solved by method" -- http://mail.python.org/mailman/listinfo/python-list