There is a function dir() that can be applied to a module. It gives us the names of all that is defined inside the module.
My doubt may be really silly, but I would like to know what dir in dir() stands for.
There is a function dir() that can be applied to a module. It gives us the names of all that is defined inside the module.
My doubt may be really silly, but I would like to know what dir in dir() stands for.
The name dir is a shortcut for directory. The same shortcut is used for the (unrelated) DOS command dir.
"dir" is the abbreviation of "directory".
The Python dir
function is used to list the objects of the current module of any objects like variables, classes, functions…
Without arguments, return the list of names in the current local scope. With an argument, attempt to return a list of valid attributes for that object.
The Python os.listdir
function is used to list the content of a directory, like the MS-DOS DIR
command.
Return a list containing the names of the entries in the directory given by path. The list is in arbitrary order, and does not include the special entries '.' and '..' even if they are present in the directory.