Is there anyway to check if an argument is a file or directory?
Like `test -d .` in bash
In the os package, in the path module, these functions appear:
isabs( path)
Return True if path is an absolute pathname (begins with a slash).
isfile( path)
Return True if path is an existing regular file. This follows symbolic links, so both islink() and isfile() can be true for the same path.
isdir( path)
Return True if path is an existing directory. This follows symbolic links, so both islink() and isdir() can be true for the same path.
In the os package, in the path module, these functions appear:
isabs( path)
Return True if path is an absolute pathname (begins with a slash).
isfile( path)
Return True if path is an existing regular file. This follows symbolic links, so both islink() and isfile() can be true for the same path.
isdir( path)
Return True if path is an existing directory. This follows symbolic links, so both islink() and isdir() can be true for the same path.
Comment