[Tutor] how to alter list content

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


hi.

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?

marc

---------------------------------------------------------------------------------------
The apocalyptic vision of a criminally insane charismatic cult leader 

   http://www.marcbuehler.net
----------------------------------------------------------------------------------------


		
__________________________________ 
Yahoo! Music Unlimited 
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/


More information about the Tutor mailing list