[Python-ideas] os.listdir with current working directory as default

Tarek Ziadé ziade.tarek at gmail.com
Sat May 23 00:51:34 CEST 2009


Hello,

A very small change: what about making the path argument optional for
os.listdir ? and use the current working directory if
not provided.

listdir(...)
    listdir(path=None) -> list_of_strings

    Return a list containing the names of the entries in the directory.

            path: path of directory to list. If path is None,
os.getcwd() is used.

    The list is in arbitrary order.  It does not include the special
    entries '.' and '..' even if they are present in the directory.


Cheers
Tarek

-- 
Tarek Ziadé | http://ziade.org



More information about the Python-ideas mailing list