Re: searching for files on Windows with Python

Discussion in 'Python' started by Fredrik Lundh, Nov 17, 2005.

  1. Shane wrote:

    > I've been giving Google a good workout with no luck. I would like to be
    > able to search a Windows filesystem for filenames, returning a list off absolute
    > paths to the found files, something like:


    maybe some variation of

    http://article.gmane.org/gmane.comp.python.general/422691

    is what you need ?

    </F>
     
    Fredrik Lundh, Nov 17, 2005
    #1
    1. Advertising

  2. Hi!

    But fnmatch (or glob) is unix-like. With few error in windows (sample ?
    trye '*.' )

    Test this code rather:

    import os
    l=os.popen4('dir c:\\python\\*.pyw /S /B')[1].readlines()
    print ''.join(l)


    @-salutations
    --
    Michel Claveau
     
    Do Re Mi chel La Si Do, Nov 17, 2005
    #2
    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. sal achhala

    Searching XML files with DOM

    sal achhala, Mar 1, 2004, in forum: Java
    Replies:
    0
    Views:
    321
    sal achhala
    Mar 1, 2004
  2. hivie

    Searching text files

    hivie, Jul 8, 2003, in forum: C++
    Replies:
    3
    Views:
    539
    John Harrison
    Jul 8, 2003
  3. =?iso-8859-4?Q?Shane?=

    searching for files on Windows with Python

    =?iso-8859-4?Q?Shane?=, Nov 17, 2005, in forum: Python
    Replies:
    4
    Views:
    418
    Kent Johnson
    Nov 19, 2005
  4. Replies:
    0
    Views:
    769
  5. stumblng.tumblr
    Replies:
    1
    Views:
    232
    stumblng.tumblr
    Feb 4, 2008
Loading...

Share This Page