On Tue, 04 Jan 2011 13:09:13 -0800, Alex Willmer wrote:

> You could also combine this into one line:
> 
> import os
> filenames_lower = [fn.lower() for fn in os.listdir('.')]

That's two lines :)

Here are a couple of nicely obfuscated one-liners:

[name.lower() for name in __import__('os').listdir('.')]

map(str.lower, __import__('os').listdir('.'))



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to