FAQ

Plissken.s at gmail.com wrote:
I have the following code which list out all the files/directories
under the current directory.

But how can I find out if 'f' is a directory?

for f in os.listdir("."):
// how can I check if 'f' a directory?
Try os.path.isdir()

--
----------------------------------------------------------------------------
Tim Daneliuk tundra at tundraware.com
PGP Key: http://www.tundraware.com/PGP/

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 2 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedMar 23, '07 at 5:40a
activeMar 23, '07 at 5:53a
posts2
users2
websitepython.org

2 users in discussion

Plissken S: 1 post Tim Daneliuk: 1 post

People

Translate

site design / logo © 2022 Grokbase