Showing posts with label info. Show all posts
Showing posts with label info. Show all posts

Saturday, January 21, 2012

Python Note 8 (Python Utilities)

Summary
filenames = os.listdir(dir) -- list of filenames in that directory path (not including . and ..). The filenames are just the names in the directory, not their absolute paths.
import os

dir="c:/"
files=os.listdir(dir)
for path in files:
    print(path)
                 
Output :
addins
AppCompat
AppPatch
assembly
avastSS.scr
bfsvc.exe


© kani.stack.notez 2012 | Blogger Template by Enny Law - Ngetik Dot Com - Nulis