[Tutor] how to alter list content

Marc Buehler marc_buehler at yahoo.com
Thu Oct 13 23:42:01 CEST 2005


i create a list of all JPG files with:
>>> list = glob.glob('*.JPG')
the content of 'list' is now:
>>> print list
['DSC00001.JPG', 'DSC00002.JPG', 'DSC00003.JPG']

but what i want is this type of list:
['DSC00001', 'DSC00002', 'DSC00003']
i.e. the names w/o the file extension.

what's the easiest way of doing this?


The apocalyptic vision of a criminally insane charismatic cult leader 


Yahoo! Music Unlimited 
Access over 1 million songs. Try it free.

More information about the Tutor mailing list