Re: get directory and file names



Alchemist a écrit :
I am working with Python 2.5 on Windows XP (SP2).

How can I traverse a folder, loop through a list of files and get
their file name and extension in an elegant, pythonic way?

http://docs.python.org/lib/module-os.path.html
http://docs.python.org/lib/os-file-dir.html
(=> os.walk)

.



Relevant Pages

  • Re: Using Item.Class to determine if item is an email item
    ... I'm using the ItemAdd event so that the work done within the loop is ... automated to run when items are added to that particular folder. ... Outlook say when I select 2 items and move them to a folder? ... It may have a file attached to it, but it's not a file and doesn't have a file extension. ...
    (microsoft.public.office.developer.outlook.vba)
  • Re: get directory and file names
    ... How can I traverse a folder, loop through a list of files and get ... their file name and extension in an elegant, ...
    (comp.lang.python)
  • Re: get directory and file names
    ... How can I traverse a folder, loop through a list of files and get ... their file name and extension in an elegant, ...
    (comp.lang.python)
  • Re: Checking a folder again after it has been emptied
    ... that while loop. ... allowing additional files in that folder to be moved and now with your ... #sleep timer and number of files ... closedir PRV_SRC_1; ...
    (perl.beginners)
  • Re: openssl extension not loading (need to open https stream)
    ... you configured PHP?" ... I have also enabled the openssl extension and made sure it is ... in the extension folder. ... the apache module ...
    (comp.lang.php)