Iterating all files in a directory
Laura Creighton
lac at strakt.com
Sat Jan 25 20:29:44 EST 2003
More information about the Python-list mailing list
Sat Jan 25 20:29:44 EST 2003
- Previous message (by thread): Iterating all files in a directory
- Next message (by thread): Iterating all files in a directory
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> How can iterate through all the files in a directory?
>
> ie. obtain a list of all the file's name
>
> Thanks.
>>> from os import listdir
>>> listdir('/tmp')
['.font-unix', '.gdm_socket', '.X11-unix', '.ICE-unix', '.X0-lock', 'ssh-XXCg2xlC', 'kde-lac', 'ksocket-lac', '.fam_socket', 'dcopWthjI2', 'mcop-lac', 'oo_branches.pdf', 'userguide.pdf']
>>>
- Previous message (by thread): Iterating all files in a directory
- Next message (by thread): Iterating all files in a directory
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list