Re: get directory and file names

2007-07-31 Thread brad
Alchemist wrote: > 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. > try this: for root, dirs, files in os.walk('.'): for f in files: print

Re: get directory and file names

2007-07-31 Thread Bruno Desthuilliers
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 (=>

Re: get directory and file names

2007-07-31 Thread Marc 'BlackJack' Rintsch
On Tue, 31 Jul 2007 07:23:06 -0700, Alchemist wrote: > 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? Take a look at the `os` and the `os.path` modules. In parti

get directory and file names

2007-07-31 Thread Alchemist
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. -- http://mail.python.org/mailman/listinfo/python-list