_check_loading_path¶
- pyhelpers.store._check_loading_path(path_to_file, verbose=False, print_prefix='', state_verb='Loading', print_suffix='', print_end=' ... ')[source]¶
Checks the status of loading a file from a specified path.
- Parameters:
path_to_file (str | bytes | pathlib.Path) – Path where the file is located.
verbose (bool | int) – Whether to print relevant information to the console; defaults to
False
.print_prefix (str) – Prefix added to the default printing message; defaults to
""
.state_verb (str) – Action verb indicating loading or reading a file; defaults to
"Loading"
.print_suffix (str) – Suffix added to the default printing message; defaults to
""
.print_end (str) – String passed to
end
parameter forprint()
; defaults to" ... "
.
Tests:
>>> from pyhelpers.store import _check_loading_path >>> from pyhelpers.dirs import cd >>> path_to_file = cd("test_func.py") >>> _check_loading_path(path_to_file, verbose=True); print("Passed.") Loading ".\test_func.py" ... Passed. >>> path_to_file = "C:\Windows\pyhelpers.pdf" >>> _check_loading_path(path_to_file, verbose=True); print("Passed.") Loading "C:\Windows\pyhelpers.pdf" ... Passed.