Listing Directories : Dircetories : File PYTHON examples


PYTHON examples » File » Dircetories »

 

Listing Directories


Listing Directories


import os 

os.listdir("c:\")                

dirname = "c:\" 

os.listdir(dirname)                                

print [for f in os.listdir(dirnameif os.path.isfile(os.path.join(dirname, f))]        [3

print [for f in os.listdir(dirnameif os.path.isdir(os.path.join(dirname, f))]            [4


           
       



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo File
» Dircetories