Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Compairing filenames in a list

Reply
Thread Tools

Re: Compairing filenames in a list

 
 
Dave Angel
Guest
Posts: n/a
 
      09-30-2012
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Compairing filenames in a list Arnaud Delobelle Python 0 09-30-2012 10:08 PM
compairing rates but comparing credits? linda UK VOIP 1 09-13-2009 07:09 PM
Compairing PasswordQuestion Answers =?Utf-8?B?TWljaGFlbA==?= ASP .Net 2 04-02-2007 09:02 PM
compairing No without Operator sonu C Programming 17 03-18-2006 12:02 AM
problem with filenames, Filenames and FILENAMES B.J. HTML 4 04-23-2005 08:13 PM



Advertisments