On 09/29/2012 09:27 PM, Kevin Anthony wrote:
> I have a list of filenames, and i need to find files with the same
> name, different extensions, and split that into tuples.  does anyone have
> any suggestions on an easy way to do this that isn't O(n^2)?
>
>

Sure, collect them in a collections.defaultdict  Use basename for the
key, and a list of names as the data item.

if that's not good enough, show us your code, and why it doesn't work,
and tell us what version of Python you're using.

-- 

DaveA

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

Reply via email to