get directory and file names



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?

Thank you.

.



Relevant Pages

  • Can you introduce some book about python?
    ... appending key-value pairs to a dict (Peter ... Is Python suitable for a huge, ... >> to the list on each loop... ...
    (comp.lang.python)
  • Re: Am I the only one who would love these extentions? - Python 3.0 proposals (long)
    ... Why is it nice enough to make it be a syntax addition, ... to point an image viewer/editor at a chunk of Python code. ... You argue consistancy to other keywords. ... Why is this new loop construct of yours useful enough ...
    (comp.lang.python)
  • Re: Help with VBA for document formatting.
    ... It means that you launched Python and asked it to load the 'processtext.py' file and it can't find it. ... Launch the Mac program "TextEdit" using Finder and from the Applications Folder. ...
    (microsoft.public.mac.office.word)
  • Re: Help with VBA for document formatting.
    ... but nothing changed - the result was the same error message. ... Applications Folder. ... Python, b. ... ...will put 1 tab stops in Body Regions;A01 ...
    (microsoft.public.mac.office.word)
  • Re: "also" to balance "else" ?
    ... some Python variant by using a different name, ... > after the loop makes it clear it evaluates after the loop is done. ... print "this is not a pipe" ... way to do it" there is already a strong bias against language ...
    (comp.lang.python)