Re: Compairing filenames in a list

Discussion in 'Python' started by Dave Angel, Sep 30, 2012.

  1. Dave Angel

    Dave Angel Guest

    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
     
    Dave Angel, Sep 30, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. B.J.
    Replies:
    4
    Views:
    747
    Toby Inkster
    Apr 23, 2005
  2. anthonyberet
    Replies:
    5
    Views:
    433
    anthonyberet
    Feb 8, 2005
  3. sonu

    compairing No without Operator

    sonu, Mar 16, 2006, in forum: C Programming
    Replies:
    17
    Views:
    544
    Mark McIntyre
    Mar 18, 2006
  4. =?Utf-8?B?TWljaGFlbA==?=

    Compairing PasswordQuestion Answers

    =?Utf-8?B?TWljaGFlbA==?=, Apr 2, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    331
    =?Utf-8?B?TWljaGFlbA==?=
    Apr 2, 2007
  5. Arnaud Delobelle

    Re: Compairing filenames in a list

    Arnaud Delobelle, Sep 30, 2012, in forum: Python
    Replies:
    0
    Views:
    211
    Arnaud Delobelle
    Sep 30, 2012
Loading...

Share This Page