FAQ
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?

Search Discussions

  • Tim Daneliuk at Mar 23, 2007 at 5:53 am

    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/

Related Discussions

Discussion Navigation
viewthread | post
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