File Operations in Python

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

Check whether a File Exists

from os.path import exists
file_exists = exists(path_to_file)
from pathlib import Path
path = Path(path_to_file)
path.is_file()