[Tutor] Extracting filenames from a List?

lonetwin lonetwin@yahoo.com
Tue, 22 Jan 2002 13:02:19 +0530


Hey Remco,

On Tuesday 22 January 2002 05:15, Remco Gerlich wrote:
> I don't know why I'm posting this since others already posted solutions,
> but whatever :)

   Good thing you did Remco, b'cos I didn't know about this:

> jpgs = [f for f in filelist if f.lower().endswith(".jpg")]
                                           ^^^^^^^^^
   Another nice 'lil function, python is *so* cool !! 
Also, just wanted to tell all the tutors, please do post alternate ways of 
doing things, even if the questions are answered. People like me get to learn 
a bit that way :)

Thanx
Peace
Steve 

-- 
Famous last words:
	(1) Don't unplug it, it will just take a moment to fix.
	(2) Let's take the shortcut, he can't see us from there.
	(3) What happens if you touch these two wires tog--
	(4) We won't need reservations.
	(5) It's always sunny there this time of the year.
	(6) Don't worry, it's not loaded.
	(7) They'd never (be stupid enough to) make him a manager.
	(8) Don't worry!  Women love it!