Full Path Ahead: Streamline Your Python Paths
·37 words·1 min
If you are reading path from outside in Python, please do yourself and others a favor by (almost) always calling full_path on it before you use it:
def full_path(path:str)->str: return os.path.abspath( os.path.expanduser( os.path.expandvars(path)))
You are welcome.