Listing Directories : Path : File PYTHON TUTORIALS


PYTHON TUTORIALS » File » Path »

 

Listing Directories


import os 

print os.listdir("c:\a\b\")        
dirname = "c:\" 
print os.listdir(dirname)                             

[for f in os.listdir(dirname
 if os.path.isfile(os.path.join(dirname, f))]    

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



Leave a Comment / Note


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


PYTHON TUTORIALS

 Navioo File
» Path