is_dir

pyhelpers.dir.is_dir(path_to_dir)

Check whether a directory-like string is a directory name.

Parameters

path_to_dir (str or bytes) – name of a directory

Returns

whether the input is a path-like string that describes a directory name

Return type

bool

Examples:

>>> from pyhelpers.dir import cd, is_dir

>>> x = "tests"
>>> is_dir(x)
False

>>> x = "/tests"
>>> is_dir(x)
True

>>> x = cd("tests")
>>> is_dir(x)
True